Version 3.10.0-48.0.dev

Merge 35e5576c8cad46b70c7ab231977e096bae1a6d9d into dev
diff --git a/pkg/_fe_analyzer_shared/lib/src/metadata/parser.dart b/pkg/_fe_analyzer_shared/lib/src/metadata/parser.dart
index 995ab18..764b0e8 100644
--- a/pkg/_fe_analyzer_shared/lib/src/metadata/parser.dart
+++ b/pkg/_fe_analyzer_shared/lib/src/metadata/parser.dart
@@ -375,7 +375,24 @@
 
   @override
   void handleEndingBinaryExpression(Token token, Token endToken) {
-    endBinaryExpression(token, endToken);
+    assert(
+    checkState(token, [
+      /* right */ _ValueKinds._Proto,
+      /* left */ _ValueKinds._Proto,
+    ]),
+    );
+    Proto right = pop() as Proto;
+    Proto left = pop() as Proto;
+    switch (token.lexeme) {
+      case '.':
+        IdentifierProto identifierProto = right as IdentifierProto;
+        push(left.apply(identifierProto));
+      case '?.':
+        IdentifierProto identifierProto = right as IdentifierProto;
+        push(left.apply(identifierProto, isNullAware: true));
+      default:
+        throw new UnimplementedError("Binary operator '${token.lexeme}'.");
+    }
   }
 
   @override
@@ -389,12 +406,6 @@
     Proto right = pop() as Proto;
     Proto left = pop() as Proto;
     switch (token.lexeme) {
-      case '.':
-        IdentifierProto identifierProto = right as IdentifierProto;
-        push(left.apply(identifierProto));
-      case '?.':
-        IdentifierProto identifierProto = right as IdentifierProto;
-        push(left.apply(identifierProto, isNullAware: true));
       case '??':
         push(
           new ExpressionProto(
diff --git a/pkg/_fe_analyzer_shared/lib/src/parser/listener.dart b/pkg/_fe_analyzer_shared/lib/src/parser/listener.dart
index b42d8c8..1803151 100644
--- a/pkg/_fe_analyzer_shared/lib/src/parser/listener.dart
+++ b/pkg/_fe_analyzer_shared/lib/src/parser/listener.dart
@@ -2075,10 +2075,7 @@
   }
 
   /// Called for `.`, `?.` and `..`.
-  void handleEndingBinaryExpression(Token token, Token endToken) {
-    // TODO(jensj): push implementation into subclasses
-    endBinaryExpression(token, endToken);
-  }
+  void handleEndingBinaryExpression(Token token, Token endToken) {}
 
   /// Called when the parser encounters a `?` operator and begins parsing a
   /// conditional expression.
diff --git a/pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart b/pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart
index 87baef0..7b1ee5f 100644
--- a/pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart
+++ b/pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart
@@ -2592,7 +2592,7 @@
       }
       listener.handleEnumElements(token, elementCount);
       if (token.isA(TokenType.SEMICOLON)) {
-        while (notEofOrValue('}', token.next!)) {
+        while (notEofOrType(TokenType.CLOSE_CURLY_BRACKET, token.next!)) {
           token = parseClassOrMixinOrExtensionOrEnumMemberImpl(
             token,
             DeclarationKind.Enum,
@@ -3718,10 +3718,6 @@
     }
   }
 
-  /// Checks whether the next token is (directly) an identifier. If this returns
-  /// true a call to [ensureIdentifier] will return the next token.
-  bool isNextIdentifier(Token token) => token.next?.kind == IDENTIFIER_TOKEN;
-
   /// Parse a simple identifier at the given [token], and return the identifier
   /// that was parsed.
   ///
@@ -3748,8 +3744,8 @@
     return identifier;
   }
 
-  bool notEofOrValue(String value, Token token) {
-    return token.kind != EOF_TOKEN && value != token.stringValue;
+  bool notEofOrType(TokenType type, Token token) {
+    return !token.isA(TokenType.EOF) && !token.isA(type);
   }
 
   Token parseTypeVariablesOpt(Token token) {
@@ -4849,7 +4845,7 @@
     assert(token.isA(TokenType.OPEN_CURLY_BRACKET));
     listener.beginClassOrMixinOrExtensionBody(kind, token);
     int count = 0;
-    while (notEofOrValue('}', token.next!)) {
+    while (notEofOrType(TokenType.CLOSE_CURLY_BRACKET, token.next!)) {
       token = parseClassOrMixinOrExtensionOrEnumMemberImpl(
         token,
         kind,
@@ -6142,7 +6138,7 @@
     loopState = LoopState.OutsideLoop;
     listener.beginBlockFunctionBody(begin);
     token = next;
-    while (notEofOrValue('}', token.next!)) {
+    while (notEofOrType(TokenType.CLOSE_CURLY_BRACKET, token.next!)) {
       Token startToken = token.next!;
       token = parseStatement(token);
       if (identical(token.next!, startToken)) {
@@ -8285,8 +8281,10 @@
 
     TypeParamOrArgInfo? potentialTypeArg;
 
-    if (isNextIdentifier(newKeyword)) {
-      Token identifier = newKeyword.next!;
+    Token next = newKeyword.next!;
+
+    if (next.kind == IDENTIFIER_TOKEN) {
+      Token identifier = next;
       String value = identifier.lexeme;
       if ((value == "Map" || value == "Set") &&
           !identifier.next!.isA(TokenType.PERIOD)) {
@@ -8336,7 +8334,7 @@
       // parseConstructorReference.
       // Do special recovery for literal maps/set/list erroneously prepended
       // with 'new'.
-      Token notIdentifier = newKeyword.next!;
+      Token notIdentifier = next;
       String value = notIdentifier.lexeme;
       if (value == "<") {
         potentialTypeArg = computeTypeParamOrArg(newKeyword);
@@ -8739,8 +8737,9 @@
     // send an `handleIdentifier` if we end up recovering.
     TypeParamOrArgInfo? potentialTypeArg;
     Token? afterToken;
-    if (isNextIdentifier(token)) {
-      Token identifier = token.next!;
+    Token next = token.next!;
+    if (next.kind == IDENTIFIER_TOKEN) {
+      Token identifier = next;
       String value = identifier.lexeme;
       if (value == "Map" || value == "Set") {
         potentialTypeArg = computeTypeParamOrArg(identifier);
@@ -9856,7 +9855,7 @@
     listener.beginBlock(begin, blockKind);
     int statementCount = 0;
     Token startToken = token.next!;
-    while (notEofOrValue('}', startToken)) {
+    while (notEofOrType(TokenType.CLOSE_CURLY_BRACKET, startToken)) {
       token = parseStatement(token);
       if (identical(token.next!, startToken)) {
         // No progress was made, so we report the current token as being invalid
@@ -10247,7 +10246,7 @@
     int caseCount = 0;
     Token? defaultKeyword = null;
     Token? colonAfterDefault = null;
-    while (notEofOrValue('}', token.next!)) {
+    while (notEofOrType(TokenType.CLOSE_CURLY_BRACKET, token.next!)) {
       Token beginCase = token.next!;
       int expressionCount = 0;
       int labelCount = 0;
@@ -10733,7 +10732,7 @@
     next = rewriter.insertSyntheticToken(token, TokenType.SEMICOLON);
     listener.handleEmptyStatement(next);
 
-    while (notEofOrValue('}', next)) {
+    while (notEofOrType(TokenType.CLOSE_CURLY_BRACKET, next)) {
       token = next;
       next = token.next!;
     }
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 c072561..af5e93e 100644
--- a/pkg/_fe_analyzer_shared/lib/src/parser/type_info.dart
+++ b/pkg/_fe_analyzer_shared/lib/src/parser/type_info.dart
@@ -470,7 +470,8 @@
 /// possible other constructs will pass (e.g., 'a < C, D > 3').
 TypeParamOrArgInfo computeMethodTypeArguments(Token token) {
   TypeParamOrArgInfo typeArg = computeTypeParamOrArg(token);
-  return mayFollowTypeArgs(typeArg.skip(token).next!) && !typeArg.recovered
+  return _mayFollowTypeArgs(typeArg.skip(token).next!.typeIndex) &&
+          !typeArg.recovered
       ? typeArg
       : noTypeParamOrArg;
 }
@@ -480,8 +481,10 @@
 /// pattern.
 const Set<String> illegalPatternIdentifiers = {'when', 'as'};
 
-/// Indicates whether the given [token] is allowed to follow a list of type
-/// arguments used as a selector after an expression.
+/// Indicates whether the given [tokenTypeIndex] is allowed to follow a list of
+/// type arguments used as a selector after an expression.
+///
+/// Get the index from a token via `Token.typeIndex`.
 ///
 /// This is used for disambiguating constructs like `f(a<b,c>(d))` and
 /// `f(a<b,c>-d)`.  In the case of `f(a<b,c>(d))`, `true` will be returned,
@@ -490,19 +493,71 @@
 /// function `a`).  In the case of `f(a<b,c>-d)`, `false` will be returned,
 /// indicating that the `<` and `>` should be interpreted as operators (so two
 /// arguments are being passed to `f`: `a < b` and `c > -d`).
-bool mayFollowTypeArgs(Token token) {
-  const Set<String> continuationTokens = {'(', '.', '==', '!='};
-  const Set<String> stopTokens = {')', ']', '}', ';', ':', ','};
-  const Set<String> tokensThatMayFollowTypeArg = {
-    ...continuationTokens,
-    ...stopTokens,
-  };
-  if (token.isA(TokenType.EOF)) {
-    // The spec doesn't have anything to say about this case, since an
-    // expression can't occur at the end of a file, but for testing it's to our
-    // advantage to allow EOF after type arguments, so that an isolated `f<x>`
-    // can be parsed as an expression.
-    return true;
-  }
-  return tokensThatMayFollowTypeArg.contains(token.lexeme);
+///
+// DartDocTest(() {
+//   for (int i = 0; i < 256; i++) {
+//     if (_mayFollowTypeArgs(i) !=
+//         _mayFollowTypeArgs_helper_for_testing(i)) {
+//       return false;
+//     }
+//   }
+//   return true;
+// }(), true);
+@pragma("vm:prefer-inline")
+bool _mayFollowTypeArgs(int tokenTypeIndex) {
+  // Table has size 256 to avoid bounds checks as this is called with
+  // `Token.typeIndex` which is know to be in [0-255].
+  const List<bool> table = [
+    // format hack.
+    true, false, false, false, false, false, false, false,
+    false, false, false, false, false, false, false, false,
+    false, false, true, false, false, false, false, false,
+    true, true, false, false, true, true, true, false,
+    true, false, false, false, false, false, false, false,
+    false, false, false, false, false, false, false, false,
+    false, false, false, false, true, false, false, false,
+    true, false, false, false, false, false, false, false,
+    false, true, false, false, false, false, false, false,
+    false, false, false, false, false, false, false, false,
+    false, false, false, false, false, false, false, false,
+    false, false, false, false, false, false, false, false,
+    false, false, false, false, false, false, false, false,
+    false, false, false, false, false, false, false, false,
+    false, false, false, false, false, false, false, false,
+    false, false, false, false, false, false, false, false,
+    false, false, false, false, false, false, false, false,
+    false, false, false, false, false, false, false, false,
+    false, false, false, false, false, false, false, false,
+    false, false, false, false, false, false, false, false,
+    false, false, false, false, false, false, false, false,
+    false, false, false, false, false, false, false, false,
+    false, false, false, false, false, false, false, false,
+    false, false, false, false, false, false, false, false,
+    false, false, false, false, false, false, false, false,
+    false, false, false, false, false, false, false, false,
+    false, false, false, false, false, false, false, false,
+    false, false, false, false, false, false, false, false,
+    false, false, false, false, false, false, false, false,
+    false, false, false, false, false, false, false, false,
+    false, false, false, false, false, false, false, false,
+    false, false, false, false, false, false, false, false,
+    // format hack.
+  ];
+
+  return table[tokenTypeIndex];
+}
+
+// ignore: unused_element
+bool _mayFollowTypeArgs_helper_for_testing(int tokenTypeIndex) {
+  return tokenTypeIndex == TokenType.OPEN_PAREN.index ||
+      tokenTypeIndex == TokenType.PERIOD.index ||
+      tokenTypeIndex == TokenType.EQ_EQ.index ||
+      tokenTypeIndex == TokenType.BANG_EQ.index ||
+      tokenTypeIndex == TokenType.CLOSE_PAREN.index ||
+      tokenTypeIndex == TokenType.CLOSE_SQUARE_BRACKET.index ||
+      tokenTypeIndex == TokenType.CLOSE_CURLY_BRACKET.index ||
+      tokenTypeIndex == TokenType.SEMICOLON.index ||
+      tokenTypeIndex == TokenType.COLON.index ||
+      tokenTypeIndex == TokenType.COMMA.index ||
+      tokenTypeIndex == TokenType.EOF.index;
 }
diff --git a/pkg/_fe_analyzer_shared/test/parser_benchmark.dart b/pkg/_fe_analyzer_shared/test/parser_benchmark.dart
index a85e608..7545783 100644
--- a/pkg/_fe_analyzer_shared/test/parser_benchmark.dart
+++ b/pkg/_fe_analyzer_shared/test/parser_benchmark.dart
@@ -74,6 +74,7 @@
     if (listener is NullListener && listener.hasErrors) {
       numErrors++;
     }
+    // Or maybe - maybe as an option - do another scan here?
   }
 
   stopwatch.stop();
diff --git a/pkg/analyzer/lib/src/fasta/ast_builder.dart b/pkg/analyzer/lib/src/fasta/ast_builder.dart
index 2b92496..9e4411e 100644
--- a/pkg/analyzer/lib/src/fasta/ast_builder.dart
+++ b/pkg/analyzer/lib/src/fasta/ast_builder.dart
@@ -1069,37 +1069,26 @@
   void endBinaryExpression(Token operatorToken, Token endToken) {
     assert(
       operatorToken.isOperator ||
-          optional('.', operatorToken) ||
-          optional('?.', operatorToken) ||
-          optional('..', operatorToken) ||
-          optional('?..', operatorToken) ||
           optional('===', operatorToken) ||
           optional('!==', operatorToken),
     );
     debugEvent("BinaryExpression");
 
-    if (identical(".", operatorToken.stringValue) ||
-        identical("?.", operatorToken.stringValue) ||
-        identical("..", operatorToken.stringValue) ||
-        identical("?..", operatorToken.stringValue)) {
-      doDotExpression(operatorToken);
-    } else {
-      var right = pop() as ExpressionImpl;
-      var left = pop() as ExpressionImpl;
-      reportErrorIfSuper(right);
-      push(
-        BinaryExpressionImpl(
-          leftOperand: left,
-          operator: operatorToken,
-          rightOperand: right,
-        ),
+    var right = pop() as ExpressionImpl;
+    var left = pop() as ExpressionImpl;
+    reportErrorIfSuper(right);
+    push(
+      BinaryExpressionImpl(
+        leftOperand: left,
+        operator: operatorToken,
+        rightOperand: right,
+      ),
+    );
+    if (!enableTripleShift && operatorToken.type == TokenType.GT_GT_GT) {
+      _reportFeatureNotEnabled(
+        feature: ExperimentalFeatures.triple_shift,
+        startToken: operatorToken,
       );
-      if (!enableTripleShift && operatorToken.type == TokenType.GT_GT_GT) {
-        _reportFeatureNotEnabled(
-          feature: ExperimentalFeatures.triple_shift,
-          startToken: operatorToken,
-        );
-      }
     }
   }
 
@@ -4364,6 +4353,19 @@
   }
 
   @override
+  void handleEndingBinaryExpression(Token operatorToken, Token endToken) {
+    assert(
+      optional('.', operatorToken) ||
+          optional('?.', operatorToken) ||
+          optional('..', operatorToken) ||
+          optional('?..', operatorToken),
+    );
+    debugEvent("EndingBinaryExpression");
+
+    doDotExpression(operatorToken);
+  }
+
+  @override
   void handleEnumElement(Token beginToken, Token? augmentToken) {
     debugEvent("EnumElement");
     var tmpArguments = pop() as MethodInvocationImpl?;
diff --git a/pkg/analyzer/lib/src/summary2/ast_binary_reader.dart b/pkg/analyzer/lib/src/summary2/ast_binary_reader.dart
index efe8097..71899fe 100644
--- a/pkg/analyzer/lib/src/summary2/ast_binary_reader.dart
+++ b/pkg/analyzer/lib/src/summary2/ast_binary_reader.dart
@@ -223,6 +223,9 @@
       arguments: arguments,
     );
     node.element = _reader.readElement();
+    if (arguments != null) {
+      _resolveNamedExpressions(node.element, arguments);
+    }
     return node;
   }
 
diff --git a/pkg/analyzer/test/src/summary/elements/metadata_test.dart b/pkg/analyzer/test/src/summary/elements/metadata_test.dart
index 73d86db..df2540c 100644
--- a/pkg/analyzer/test/src/summary/elements/metadata_test.dart
+++ b/pkg/analyzer/test/src/summary/elements/metadata_test.dart
@@ -1452,6 +1452,81 @@
 ''');
   }
 
+  test_metadata_constructor_namedArgument() async {
+    newFile('$testPackageLibPath/a.dart', r'''
+class A {
+  const A({required int value});
+}
+''');
+
+    var library = await buildLibrary(r'''
+import 'a.dart';
+@A(value: 42)
+void f() {}
+''');
+    checkElementText(library, r'''
+library
+  reference: <testLibrary>
+  fragments
+    #F0 <testLibraryFragment>
+      element: <testLibrary>
+      libraryImports
+        package:test/a.dart
+      functions
+        #F1 f (nameOffset:36) (firstTokenOffset:17) (offset:36)
+          element: <testLibrary>::@function::f
+          metadata
+            Annotation
+              atSign: @ @17
+              name: SimpleIdentifier
+                token: A @18
+                element: package:test/a.dart::@class::A
+                staticType: null
+              arguments: ArgumentList
+                leftParenthesis: ( @19
+                arguments
+                  NamedExpression
+                    name: Label
+                      label: SimpleIdentifier
+                        token: value @20
+                        element: package:test/a.dart::@class::A::@constructor::new::@formalParameter::value
+                        staticType: null
+                      colon: : @25
+                    expression: IntegerLiteral
+                      literal: 42 @27
+                      staticType: int
+                rightParenthesis: ) @29
+              element2: package:test/a.dart::@class::A::@constructor::new
+  functions
+    f
+      reference: <testLibrary>::@function::f
+      firstFragment: #F1
+      metadata
+        Annotation
+          atSign: @ @17
+          name: SimpleIdentifier
+            token: A @18
+            element: package:test/a.dart::@class::A
+            staticType: null
+          arguments: ArgumentList
+            leftParenthesis: ( @19
+            arguments
+              NamedExpression
+                name: Label
+                  label: SimpleIdentifier
+                    token: value @20
+                    element: package:test/a.dart::@class::A::@constructor::new::@formalParameter::value
+                    staticType: null
+                  colon: : @25
+                expression: IntegerLiteral
+                  literal: 42 @27
+                  staticType: int
+            rightParenthesis: ) @29
+          element2: package:test/a.dart::@class::A::@constructor::new
+      returnType: void
+''');
+  }
+
   test_metadata_constructorDeclaration_named() async {
     var library = await buildLibrary(
       'const a = null; class C { @a C.named(); }',
diff --git a/pkg/analyzer/tool/summary/mini_ast.dart b/pkg/analyzer/tool/summary/mini_ast.dart
index 46d00dc..c6eb161 100644
--- a/pkg/analyzer/tool/summary/mini_ast.dart
+++ b/pkg/analyzer/tool/summary/mini_ast.dart
@@ -219,19 +219,9 @@
   void endBinaryExpression(Token token, Token endToken) {
     debugEvent("BinaryExpression");
 
-    if (identical('.', token.stringValue)) {
-      var rightOperand = pop() as String;
-      var leftOperand = pop();
-      if (leftOperand is String && !leftOperand.contains('.')) {
-        push(PrefixedIdentifier(leftOperand, token, rightOperand));
-      } else {
-        push(UnknownExpression());
-      }
-    } else {
-      pop(); // RHS
-      pop(); // LHS
-      push(UnknownExpression());
-    }
+    pop(); // RHS
+    pop(); // LHS
+    push(UnknownExpression());
   }
 
   @override
@@ -479,6 +469,25 @@
   }
 
   @override
+  void handleEndingBinaryExpression(Token token, Token endToken) {
+    debugEvent("EndingBinaryExpression");
+
+    if (identical('.', token.stringValue)) {
+      var rightOperand = pop() as String;
+      var leftOperand = pop();
+      if (leftOperand is String && !leftOperand.contains('.')) {
+        push(PrefixedIdentifier(leftOperand, token, rightOperand));
+      } else {
+        push(UnknownExpression());
+      }
+    } else {
+      pop(); // RHS
+      pop(); // LHS
+      push(UnknownExpression());
+    }
+  }
+
+  @override
   void handleEnumElement(Token beginToken, Token? augmentToken) {
     debugEvent("EnumElement");
     pop(); // Arguments.
diff --git a/pkg/front_end/lib/src/base/incremental_compiler.dart b/pkg/front_end/lib/src/base/incremental_compiler.dart
index 10a82f6..85c75ea 100644
--- a/pkg/front_end/lib/src/base/incremental_compiler.dart
+++ b/pkg/front_end/lib/src/base/incremental_compiler.dart
@@ -1689,9 +1689,8 @@
 
       Class? cls;
       if (className != null) {
-        Builder? scopeMember = libraryBuilder.libraryNameSpace
-            .lookupLocalMember(className)
-            ?.getable;
+        Builder? scopeMember =
+            libraryBuilder.libraryNameSpace.lookup(className)?.getable;
         if (scopeMember is ClassBuilder) {
           cls = scopeMember.cls;
         } else {
@@ -1706,9 +1705,8 @@
         if (indexOfDot >= 0) {
           String beforeDot = methodName.substring(0, indexOfDot);
           String afterDot = methodName.substring(indexOfDot + 1);
-          Builder? builder = libraryBuilder.libraryNameSpace
-              .lookupLocalMember(beforeDot)
-              ?.getable;
+          Builder? builder =
+              libraryBuilder.libraryNameSpace.lookup(beforeDot)?.getable;
           extensionName = beforeDot;
           if (builder is ExtensionBuilder) {
             extension = builder.extension;
diff --git a/pkg/front_end/lib/src/base/local_scope.dart b/pkg/front_end/lib/src/base/local_scope.dart
index b6e3b60..3c0632b 100644
--- a/pkg/front_end/lib/src/base/local_scope.dart
+++ b/pkg/front_end/lib/src/base/local_scope.dart
@@ -11,6 +11,9 @@
   @override
   ScopeKind get kind;
 
+  @override
+  LookupResult? lookup(String name, {int fileOffset = -1});
+
   LocalScope createNestedScope(
       {required String debugName, required ScopeKind kind});
 
@@ -51,7 +54,7 @@
 }
 
 mixin LocalScopeMixin implements LocalScope {
-  LookupScope? get _parent;
+  LocalScope? get _parent;
 
   Map<String, VariableBuilder>? get _local;
 
@@ -59,9 +62,9 @@
   Iterable<VariableBuilder> get localVariables => _local?.values ?? const [];
 
   @override
-  LookupResult? lookup(String name, int fileOffset, Uri fileUri) {
+  LookupResult? lookup(String name, {int fileOffset = -1}) {
     _recordUse(name, fileOffset);
-    return _local?[name] ?? _parent?.lookup(name, fileOffset, fileUri);
+    return _local?[name] ?? _parent?.lookup(name, fileOffset: fileOffset);
   }
 
   @override
@@ -156,8 +159,8 @@
   Iterable<VariableBuilder> get localVariables => const [];
 
   @override
-  LookupResult? lookup(String name, int fileOffset, Uri fileUri) {
-    return _local?[name] ?? _parent?.lookup(name, fileOffset, fileUri);
+  LookupResult? lookup(String name, {int fileOffset = -1}) {
+    return _local?[name] ?? _parent?.lookup(name, fileOffset: fileOffset);
   }
 
   @override
@@ -201,13 +204,13 @@
 final class FormalParameterScope extends BaseLocalScope
     with ImmutableLocalScopeMixin, LocalScopeMixin {
   @override
-  final LookupScope? _parent;
+  final LocalScope? _parent;
   @override
   final Map<String, VariableBuilder>? _local;
 
   FormalParameterScope(
-      {LookupScope? parent, Map<String, VariableBuilder>? local})
-      : _parent = parent,
+      {required LookupScope parent, Map<String, VariableBuilder>? local})
+      : _parent = new EnclosingLocalScope(parent),
         _local = local;
 
   @override
@@ -232,8 +235,8 @@
   Iterable<VariableBuilder> get localVariables => const [];
 
   @override
-  LookupResult? lookup(String name, int fileOffset, Uri fileUri) {
-    return _scope.lookup(name, fileOffset, fileUri);
+  LookupResult? lookup(String name, {int fileOffset = -1}) {
+    return _scope.lookup(name);
   }
 
   @override
diff --git a/pkg/front_end/lib/src/base/lookup_result.dart b/pkg/front_end/lib/src/base/lookup_result.dart
index c4db79d..2351531 100644
--- a/pkg/front_end/lib/src/base/lookup_result.dart
+++ b/pkg/front_end/lib/src/base/lookup_result.dart
@@ -9,7 +9,6 @@
 import '../builder/member_builder.dart';
 import '../codes/cfe_codes.dart';
 import 'compiler_context.dart';
-import 'scope.dart';
 
 abstract class LookupResult {
   /// The [NamedBuilder] used for reading this entity, if any.
@@ -62,37 +61,6 @@
     return new InvalidExpression(text)..fileOffset = fileOffset;
   }
 
-  /// Creates a [LookupResult] for [getable] and [setable] which filters
-  /// instance members if [staticOnly] is `true`, and creates an
-  /// [AmbiguousBuilder] for duplicates using [fileUri] and [fileOffset].
-  static LookupResult? createProcessedResult(LookupResult? result,
-      {required String name, required Uri fileUri, required int fileOffset}) {
-    if (result == null) return null;
-    NamedBuilder? getable = result.getable;
-    NamedBuilder? setable = result.setable;
-    bool changed = false;
-    if (getable != null) {
-      if (getable.next != null) {
-        // Coverage-ignore-block(suite): Not run.
-        getable = new AmbiguousBuilder(name, getable, fileOffset, fileUri);
-        changed = true;
-      }
-    }
-    if (setable != null) {
-      if (setable.next != null) {
-        // Coverage-ignore-block(suite): Not run.
-        setable = new AmbiguousBuilder(name, setable, fileOffset, fileUri);
-        changed = true;
-      }
-    }
-    if (!changed) {
-      return result;
-    }
-
-    // Coverage-ignore(suite): Not run.
-    return _fromBuilders(getable, setable, assertNoGetterSetterConflict: true);
-  }
-
   static LookupResult? createResult(
       NamedBuilder? getable, NamedBuilder? setable) {
     return _fromBuilders(getable, setable, assertNoGetterSetterConflict: false);
diff --git a/pkg/front_end/lib/src/base/name_space.dart b/pkg/front_end/lib/src/base/name_space.dart
index abb82c9..97187bc 100644
--- a/pkg/front_end/lib/src/base/name_space.dart
+++ b/pkg/front_end/lib/src/base/name_space.dart
@@ -12,18 +12,7 @@
 abstract class NameSpace {
   /// Returns the [LookupResult] for the [Builder]s of the given [name] in the
   /// name space.
-  ///
-  /// If the [Builder]s are duplicates, an [AmbiguousBuilder] is created for
-  /// the access, using the [fileUri] and [fileOffset].
-  LookupResult? lookupLocal(String name,
-      {required Uri fileUri, required int fileOffset});
-
-  /// Returns the [LookupResult] for the [Builder]s of the given [name] in the
-  /// name space.
-  ///
-  /// The returned [LookupResult] contains the [Builder]s directly mapped in the
-  /// name space without any filtering or processed of duplicates.
-  LookupResult? lookupLocalMember(String name);
+  LookupResult? lookup(String name);
 
   void forEachLocalExtension(void Function(ExtensionBuilder member) f);
 }
@@ -66,12 +55,7 @@
   void forEachLocalExtension(void Function(ExtensionBuilder member) f) {}
 
   @override
-  MemberLookupResult? lookupLocal(String name,
-          {required Uri fileUri, required int fileOffset}) =>
-      _content[name];
-
-  @override
-  MemberLookupResult? lookupLocalMember(String name) => _content[name];
+  MemberLookupResult? lookup(String name) => _content[name];
 
   MemberLookupResult? lookupConstructor(String name) => _constructors[name];
 }
@@ -180,14 +164,7 @@
   }
 
   @override
-  LookupResult? lookupLocal(String name,
-      {required Uri fileUri, required int fileOffset}) {
-    return LookupResult.createProcessedResult(_content?[name],
-        name: name, fileUri: fileUri, fileOffset: fileOffset);
-  }
-
-  @override
-  LookupResult? lookupLocalMember(String name) => _content?[name];
+  LookupResult? lookup(String name) => _content?[name];
 }
 
 final class LibraryNameSpace implements NameSpace {
@@ -212,13 +189,7 @@
   }
 
   @override
-  LookupResult? lookupLocal(String name,
-      {required Uri fileUri, required int fileOffset}) {
-    return _content[name];
-  }
-
-  @override
-  LookupResult? lookupLocalMember(String name) => _content[name];
+  LookupResult? lookup(String name) => _content[name];
 }
 
 // Coverage-ignore(suite): Not run.
@@ -356,16 +327,16 @@
         LookupResult? replacementResult;
         if (existingGetter != null && existingSetter != null) {
           if (existingGetter == existingSetter) {
-            replacementResult = replacementNameSpaceMap[existingGetter.parent]!
-                .lookupLocalMember(name);
+            replacementResult =
+                replacementNameSpaceMap[existingGetter.parent]!.lookup(name);
           } else {
             NamedBuilder? replacementGetter =
                 replacementNameSpaceMap[existingGetter.parent]
-                    ?.lookupLocalMember(name)
+                    ?.lookup(name)
                     ?.getable;
             NamedBuilder? replacementSetter =
                 replacementNameSpaceMap[existingSetter.parent]
-                    ?.lookupLocalMember(name)
+                    ?.lookup(name)
                     ?.setable;
             replacementResult = LookupResult.createResult(
                 replacementGetter ?? existingGetter,
@@ -374,14 +345,14 @@
         } else if (existingGetter != null) {
           replacementResult = LookupResult.createResult(
               replacementNameSpaceMap[existingGetter.parent]
-                  ?.lookupLocalMember(name)
+                  ?.lookup(name)
                   ?.getable,
               null);
         } else if (existingSetter != null) {
           replacementResult = LookupResult.createResult(
               null,
               replacementNameSpaceMap[existingSetter.parent]
-                  ?.lookupLocalMember(name)
+                  ?.lookup(name)
                   ?.setable);
         }
         if (replacementResult != null) {
@@ -411,12 +382,12 @@
           if (replacementNameSpaceMap
               .containsKey(extensionBuilder.libraryBuilder)) {
             assert(replacementNameSpaceMap[extensionBuilder.libraryBuilder]!
-                    .lookupLocalMember(extensionBuilder.name)!
+                    .lookup(extensionBuilder.name)!
                     .getable !=
                 null);
             extensionsReplacement.add(
                 replacementNameSpaceMap[extensionBuilder.libraryBuilder]!
-                    .lookupLocalMember(extensionBuilder.name)!
+                    .lookup(extensionBuilder.name)!
                     .getable as ExtensionBuilder);
             break;
           } else {
diff --git a/pkg/front_end/lib/src/base/scope.dart b/pkg/front_end/lib/src/base/scope.dart
index 8fa70b6..44b19cc 100644
--- a/pkg/front_end/lib/src/base/scope.dart
+++ b/pkg/front_end/lib/src/base/scope.dart
@@ -122,7 +122,7 @@
 
 abstract class LookupScope {
   ScopeKind get kind;
-  LookupResult? lookup(String name, int fileOffset, Uri fileUri);
+  LookupResult? lookup(String name);
   // TODO(johnniwinther): Should this be moved to an outer scope interface?
   void forEachExtension(void Function(ExtensionBuilder) f);
 }
@@ -139,10 +139,8 @@
   LookupScope? get _parent;
 
   @override
-  LookupResult? lookup(String name, int fileOffset, Uri fileUri) {
-    return _nameSpace.lookupLocal(name,
-            fileUri: fileUri, fileOffset: fileOffset) ??
-        _parent?.lookup(name, fileOffset, fileUri);
+  LookupResult? lookup(String name) {
+    return _nameSpace.lookup(name) ?? _parent?.lookup(name);
   }
 
   @override
@@ -174,13 +172,12 @@
   TypeParameterBuilder? getTypeParameter(String name);
 
   @override
-  // Coverage-ignore(suite): Not run.
   ScopeKind get kind => ScopeKind.typeParameters;
 
   @override
-  LookupResult? lookup(String name, int fileOffset, Uri fileUri) {
+  LookupResult? lookup(String name) {
     LookupResult? result = getTypeParameter(name);
-    return result ?? _parent.lookup(name, fileOffset, fileUri);
+    return result ?? _parent.lookup(name);
   }
 
   @override
@@ -379,48 +376,6 @@
       errorHasBeenReported: false);
 }
 
-// Coverage-ignore(suite): Not run.
-abstract class ProblemBuilder extends NamedBuilderImpl {
-  @override
-  final String name;
-
-  final NamedBuilder builder;
-
-  @override
-  final int fileOffset;
-
-  @override
-  final Uri fileUri;
-
-  ProblemBuilder(this.name, this.builder, this.fileOffset, this.fileUri);
-
-  Message get message;
-
-  @override
-  String get fullNameForErrors => name;
-}
-
-// Coverage-ignore(suite): Not run.
-class AmbiguousBuilder extends ProblemBuilder {
-  AmbiguousBuilder(
-      String name, NamedBuilder builder, int charOffset, Uri fileUri)
-      : super(name, builder, charOffset, fileUri);
-
-  @override
-  Builder? get parent => null;
-
-  @override
-  Message get message => templateDuplicatedDeclarationUse.withArguments(name);
-
-  NamedBuilder getFirstDeclaration() {
-    NamedBuilder declaration = builder;
-    while (declaration.next != null) {
-      declaration = declaration.next!;
-    }
-    return declaration;
-  }
-}
-
 mixin ErroneousMemberBuilderMixin implements SourceMemberBuilder {
   @override
   // Coverage-ignore(suite): Not run.
diff --git a/pkg/front_end/lib/src/builder/builder_mixins.dart b/pkg/front_end/lib/src/builder/builder_mixins.dart
index 5d4d0f5..55b2d08 100644
--- a/pkg/front_end/lib/src/builder/builder_mixins.dart
+++ b/pkg/front_end/lib/src/builder/builder_mixins.dart
@@ -28,7 +28,7 @@
         name.startsWith("_")) {
       return null;
     }
-    MemberLookupResult? result = nameSpace.lookupLocalMember(name);
+    MemberLookupResult? result = nameSpace.lookup(name);
     if (result != null && !result.isStatic) {
       result = null;
     }
@@ -60,7 +60,7 @@
 
   @override
   LookupResult? lookupLocalMember(String name, {bool required = false}) {
-    LookupResult? result = nameSpace.lookupLocalMember(name);
+    LookupResult? result = nameSpace.lookup(name);
     if (required && result == null) {
       internalProblem(
           templateInternalProblemNotFoundIn.withArguments(
diff --git a/pkg/front_end/lib/src/builder/constructor_reference_builder.dart b/pkg/front_end/lib/src/builder/constructor_reference_builder.dart
index 3681533..fca386a 100644
--- a/pkg/front_end/lib/src/builder/constructor_reference_builder.dart
+++ b/pkg/front_end/lib/src/builder/constructor_reference_builder.dart
@@ -39,15 +39,14 @@
     if (qualifier != null) {
       String prefix = qualifier;
       String middle = typeName.name;
-      declaration = scope.lookup(prefix, charOffset, fileUri)?.getable;
+      declaration = scope.lookup(prefix)?.getable;
       if (declaration is TypeAliasBuilder) {
         TypeAliasBuilder aliasBuilder = declaration;
         declaration = aliasBuilder.unaliasDeclaration(typeArguments);
       }
       if (declaration is PrefixBuilder) {
         PrefixBuilder prefix = declaration;
-        declaration =
-            prefix.lookup(middle, typeName.nameOffset, fileUri)?.getable;
+        declaration = prefix.lookup(middle)?.getable;
       } else if (declaration is DeclarationBuilder) {
         MemberLookupResult? result =
             declaration.findConstructorOrFactory(middle, accessingLibrary);
@@ -57,7 +56,7 @@
         }
       }
     } else {
-      declaration = scope.lookup(typeName.name, charOffset, fileUri)?.getable;
+      declaration = scope.lookup(typeName.name)?.getable;
       if (declaration is TypeAliasBuilder) {
         TypeAliasBuilder aliasBuilder = declaration;
         declaration = aliasBuilder.unaliasDeclaration(typeArguments);
diff --git a/pkg/front_end/lib/src/builder/invalid_builder.dart b/pkg/front_end/lib/src/builder/invalid_builder.dart
index a64eac7..33fe5f7 100644
--- a/pkg/front_end/lib/src/builder/invalid_builder.dart
+++ b/pkg/front_end/lib/src/builder/invalid_builder.dart
@@ -83,6 +83,7 @@
   }
 
   @override
+  // TODO(johnniwinther): This should probably return `null`.
   MemberBuilder get getable => this;
 
   @override
diff --git a/pkg/front_end/lib/src/builder/library_builder.dart b/pkg/front_end/lib/src/builder/library_builder.dart
index 70bae45..c8f05fe 100644
--- a/pkg/front_end/lib/src/builder/library_builder.dart
+++ b/pkg/front_end/lib/src/builder/library_builder.dart
@@ -177,7 +177,7 @@
           null);
     }
     Builder? cls = (bypassLibraryPrivacy ? libraryNameSpace : exportNameSpace)
-        .lookupLocalMember(className)
+        .lookup(className)
         ?.getable;
     if (cls is TypeAliasBuilder) {
       // Coverage-ignore-block(suite): Not run.
@@ -217,12 +217,12 @@
 
   @override
   LookupResult? lookupLocalMember(String name) {
-    return libraryNameSpace.lookupLocalMember(name);
+    return libraryNameSpace.lookup(name);
   }
 
   @override
   NamedBuilder? lookupRequiredLocalMember(String name) {
-    NamedBuilder? builder = libraryNameSpace.lookupLocalMember(name)?.getable;
+    NamedBuilder? builder = libraryNameSpace.lookup(name)?.getable;
     if (builder == null) {
       internalProblem(
           templateInternalProblemNotFoundIn.withArguments(
diff --git a/pkg/front_end/lib/src/builder/named_type_builder.dart b/pkg/front_end/lib/src/builder/named_type_builder.dart
index 186e4a5..24fd408 100644
--- a/pkg/front_end/lib/src/builder/named_type_builder.dart
+++ b/pkg/front_end/lib/src/builder/named_type_builder.dart
@@ -207,7 +207,7 @@
     Builder? member;
     String? qualifier = typeName.qualifier;
     if (qualifier != null) {
-      LookupResult? result = scope.lookup(qualifier, charOffset, fileUri);
+      LookupResult? result = scope.lookup(qualifier);
       if (result != null && result.isInvalidLookup) {
         bind(
             problemReporting,
@@ -222,7 +222,7 @@
       Builder? prefix = result?.getable;
       if (prefix is PrefixBuilder) {
         _isDeferred = prefix.deferred;
-        result = prefix.lookup(typeName.name, typeName.nameOffset, fileUri);
+        result = prefix.lookup(typeName.name);
         if (result != null && result.isInvalidLookup) {
           // Coverage-ignore-block(suite): Not run.
           bind(
@@ -250,8 +250,7 @@
         return;
       }
     } else {
-      LookupResult? result =
-          scope.lookup(typeName.name, typeName.nameOffset, fileUri);
+      LookupResult? result = scope.lookup(typeName.name);
       if (result != null && result.isInvalidLookup) {
         bind(
             problemReporting,
diff --git a/pkg/front_end/lib/src/builder/prefix_builder.dart b/pkg/front_end/lib/src/builder/prefix_builder.dart
index 367e1c0..87dc805 100644
--- a/pkg/front_end/lib/src/builder/prefix_builder.dart
+++ b/pkg/front_end/lib/src/builder/prefix_builder.dart
@@ -68,8 +68,8 @@
   LibraryDependency? get dependency => loadLibraryBuilder?.importDependency;
 
   /// Lookup a member with [name] in the export scope.
-  LookupResult? lookup(String name, int charOffset, Uri fileUri) {
-    return _prefixScope.lookup(name, charOffset, fileUri);
+  LookupResult? lookup(String name) {
+    return _prefixScope.lookup(name);
   }
 
   void addToPrefixScope(String name, NamedBuilder member,
@@ -81,7 +81,7 @@
 
     bool isSetter = isMappedAsSetter(member);
 
-    LookupResult? existingResult = _prefixNameSpace.lookupLocalMember(name);
+    LookupResult? existingResult = _prefixNameSpace.lookup(name);
     NamedBuilder? existing =
         isSetter ? existingResult?.setable : existingResult?.getable;
     if (existing != null) {
diff --git a/pkg/front_end/lib/src/dill/dill_library_builder.dart b/pkg/front_end/lib/src/dill/dill_library_builder.dart
index 1089c7e..f2ac9b10 100644
--- a/pkg/front_end/lib/src/dill/dill_library_builder.dart
+++ b/pkg/front_end/lib/src/dill/dill_library_builder.dart
@@ -356,7 +356,7 @@
   @override
   void becomeCoreLibrary() {
     const String dynamicName = "dynamic";
-    if (libraryNameSpace.lookupLocalMember(dynamicName)?.getable == null) {
+    if (libraryNameSpace.lookup(dynamicName)?.getable == null) {
       DynamicTypeDeclarationBuilder builder =
           new DynamicTypeDeclarationBuilder(const DynamicType(), this, -1);
       _nameSpace.addLocalMember(dynamicName, builder);
@@ -364,14 +364,14 @@
       _memberBuilders.add(builder);
     }
     const String neverName = "Never";
-    if (libraryNameSpace.lookupLocalMember(neverName)?.getable == null) {
+    if (libraryNameSpace.lookup(neverName)?.getable == null) {
       NeverTypeDeclarationBuilder builder = new NeverTypeDeclarationBuilder(
           const NeverType.nonNullable(), this, -1);
       _nameSpace.addLocalMember(neverName, builder);
       _exportNameSpace.addLocalMember(neverName, builder, setter: false);
       _memberBuilders.add(builder);
     }
-    assert(libraryNameSpace.lookupLocalMember("Null")?.getable != null,
+    assert(libraryNameSpace.lookup("Null")?.getable != null,
         "No class 'Null' found in dart:core.");
   }
 
@@ -401,14 +401,10 @@
       if (messageText == exportDynamicSentinel) {
         assert(
             name == 'dynamic', "Unexpected export name for 'dynamic': '$name'");
-        declaration = loader.coreLibrary.exportNameSpace
-            .lookupLocalMember(name)!
-            .getable!;
+        declaration = loader.coreLibrary.exportNameSpace.lookup(name)!.getable!;
       } else if (messageText == exportNeverSentinel) {
         assert(name == 'Never', "Unexpected export name for 'Never': '$name'");
-        declaration = loader.coreLibrary.exportNameSpace
-            .lookupLocalMember(name)!
-            .getable!;
+        declaration = loader.coreLibrary.exportNameSpace.lookup(name)!.getable!;
       } else {
         Message message = templateUnspecified.withArguments(messageText);
         if (!suppressFinalizationErrors) {
@@ -477,12 +473,10 @@
         assert(library is DillLibraryBuilder,
             "No reference for source declaration of $node.");
         if (isSetter) {
-          declaration =
-              library.exportNameSpace.lookupLocalMember(name)!.setable!;
+          declaration = library.exportNameSpace.lookup(name)!.setable!;
           _exportNameSpace.addLocalMember(name, declaration, setter: true);
         } else {
-          declaration =
-              library.exportNameSpace.lookupLocalMember(name)!.getable!;
+          declaration = library.exportNameSpace.lookup(name)!.getable!;
           _exportNameSpace.addLocalMember(name, declaration, setter: false);
         }
       }
diff --git a/pkg/front_end/lib/src/kernel/body_builder.dart b/pkg/front_end/lib/src/kernel/body_builder.dart
index 269ddfc..d104001 100644
--- a/pkg/front_end/lib/src/kernel/body_builder.dart
+++ b/pkg/front_end/lib/src/kernel/body_builder.dart
@@ -642,10 +642,6 @@
     } else if (node is SuperInitializer) {
       return buildProblem(
           cfe.messageSuperAsExpression, node.fileOffset, noLength);
-    }
-    // Coverage-ignore(suite): Not run.
-    else if (node is ProblemBuilder) {
-      return node.toExpression(libraryBuilder);
     } else {
       return unhandled("${node.runtimeType}", "toValue", -1, uri);
     }
@@ -663,11 +659,6 @@
       return forest.createConstantPattern(node.buildSimpleRead());
     } else if (node is Expression) {
       return forest.createConstantPattern(node);
-    }
-    // Coverage-ignore(suite): Not run.
-    else if (node is ProblemBuilder) {
-      Expression expression = node.toExpression(libraryBuilder);
-      return forest.createConstantPattern(expression);
     } else {
       return unhandled("${node.runtimeType}", "toPattern", -1, uri);
     }
@@ -857,7 +848,6 @@
       /*type*/ unionOfKinds([
         ValueKinds.Generator,
         ValueKinds.QualifiedName,
-        ValueKinds.ProblemBuilder,
         ValueKinds.ParserRecovery
       ])
     ]));
@@ -869,11 +859,7 @@
       /*constructor name identifier*/ ValueKinds.IdentifierOrNull,
       /*constructor name*/ ValueKinds.Name,
       /*type arguments*/ ValueKinds.TypeArgumentsOrNull,
-      /*class*/ unionOfKinds([
-        ValueKinds.Generator,
-        ValueKinds.ProblemBuilder,
-        ValueKinds.ParserRecovery
-      ]),
+      /*class*/ unionOfKinds([ValueKinds.Generator, ValueKinds.ParserRecovery]),
     ]));
     if (arguments != null) {
       push(arguments);
@@ -1716,7 +1702,6 @@
       unionOfKinds([
         ValueKinds.Expression,
         ValueKinds.Generator,
-        ValueKinds.ProblemBuilder,
       ])
     ]));
     Expression expression = popForValue();
@@ -2159,7 +2144,6 @@
       unionOfKinds([
         ValueKinds.Expression,
         ValueKinds.Generator,
-        ValueKinds.ProblemBuilder,
       ]),
     ]));
     debugEvent("ExpressionStatement");
@@ -2262,7 +2246,6 @@
           unionOfKinds([
             ValueKinds.Expression,
             ValueKinds.Generator,
-            ValueKinds.ProblemBuilder,
           ]),
           unionOfKinds([
             ValueKinds.Expression,
@@ -2271,7 +2254,6 @@
           unionOfKinds([
             ValueKinds.Expression,
             ValueKinds.Generator,
-            ValueKinds.ProblemBuilder,
           ]),
         ]));
         guard = popForValue();
@@ -2284,7 +2266,6 @@
         unionOfKinds([
           ValueKinds.Expression,
           ValueKinds.Generator,
-          ValueKinds.ProblemBuilder,
         ]),
       ]));
       reportIfNotEnabled(
@@ -2298,7 +2279,6 @@
         unionOfKinds([
           ValueKinds.Expression,
           ValueKinds.Generator,
-          ValueKinds.ProblemBuilder,
         ]),
       ]));
       push(new Condition(popForValue()));
@@ -2314,7 +2294,6 @@
       unionOfKinds([
         ValueKinds.Expression,
         ValueKinds.Generator,
-        ValueKinds.ProblemBuilder,
       ]),
     ]));
     debugEvent("ParenthesizedExpression");
@@ -2347,7 +2326,6 @@
       unionOfKinds([
         ValueKinds.Expression,
         ValueKinds.Generator,
-        ValueKinds.ProblemBuilder,
         ValueKinds.Pattern,
       ])
     ]));
@@ -2376,7 +2354,6 @@
         ValueKinds.Generator,
         ValueKinds.Identifier,
         ValueKinds.ParserRecovery,
-        ValueKinds.ProblemBuilder
       ])
     ]));
     debugEvent("Send");
@@ -2424,7 +2401,6 @@
         ValueKinds.Expression,
         ValueKinds.Generator,
         ValueKinds.Initializer,
-        ValueKinds.ProblemBuilder,
         ValueKinds.Selector,
       ])
     ]));
@@ -2514,12 +2490,10 @@
         unionOfKinds([
           ValueKinds.Expression,
           ValueKinds.Generator,
-          ValueKinds.ProblemBuilder,
         ]),
       unionOfKinds([
         ValueKinds.Expression,
         ValueKinds.Generator,
-        ValueKinds.ProblemBuilder,
         ValueKinds.Pattern,
       ]),
       ValueKinds.ConstantContext,
@@ -2558,7 +2532,6 @@
       unionOfKinds([
         ValueKinds.Expression,
         ValueKinds.Generator,
-        ValueKinds.ProblemBuilder,
       ]),
     ]));
     bool isAnd = token.isA(TokenType.AMPERSAND_AMPERSAND);
@@ -2575,7 +2548,34 @@
       unionOfKinds([
         ValueKinds.Expression,
         ValueKinds.Generator,
-        ValueKinds.ProblemBuilder,
+      ]),
+    ]));
+  }
+
+  @override
+  void handleEndingBinaryExpression(Token token, Token endToken) {
+    assert(checkState(token, [
+      unionOfKinds([
+        ValueKinds.Expression,
+        ValueKinds.Generator,
+        ValueKinds.Selector,
+      ]),
+    ]));
+    debugEvent("BinaryExpression");
+    if (token.isA(TokenType.PERIOD) ||
+        token.isA(TokenType.PERIOD_PERIOD) ||
+        token.isA(TokenType.QUESTION_PERIOD_PERIOD)) {
+      doDotOrCascadeExpression(token);
+    } else if (token.isA(TokenType.QUESTION_PERIOD)) {
+      doIfNotNull(token);
+    } else {
+      throw new UnsupportedError("Unexpected ending binary $token.");
+    }
+    assert(checkState(token, [
+      unionOfKinds([
+        ValueKinds.Expression,
+        ValueKinds.Generator,
+        ValueKinds.Initializer,
       ]),
     ]));
   }
@@ -2586,22 +2586,15 @@
       unionOfKinds([
         ValueKinds.Expression,
         ValueKinds.Generator,
-        ValueKinds.ProblemBuilder,
         ValueKinds.Selector,
       ]),
     ]));
     debugEvent("BinaryExpression");
-    if (token.isA(TokenType.PERIOD) ||
-        token.isA(TokenType.PERIOD_PERIOD) ||
-        token.isA(TokenType.QUESTION_PERIOD_PERIOD)) {
-      doDotOrCascadeExpression(token);
-    } else if (token.isA(TokenType.AMPERSAND_AMPERSAND) ||
+    if (token.isA(TokenType.AMPERSAND_AMPERSAND) ||
         token.isA(TokenType.BAR_BAR)) {
       doLogicalExpression(token);
     } else if (token.isA(TokenType.QUESTION_QUESTION)) {
       doIfNull(token);
-    } else if (token.isA(TokenType.QUESTION_PERIOD)) {
-      doIfNotNull(token);
     } else {
       doBinaryExpression(token);
     }
@@ -2633,7 +2626,6 @@
       unionOfKinds([
         ValueKinds.Expression,
         ValueKinds.Generator,
-        ValueKinds.ProblemBuilder,
         ValueKinds.Pattern,
       ]),
     ]));
@@ -2675,7 +2667,6 @@
       unionOfKinds([
         ValueKinds.Expression,
         ValueKinds.Generator,
-        ValueKinds.ProblemBuilder,
         ValueKinds.Pattern,
       ]),
     ]));
@@ -2707,13 +2698,11 @@
       unionOfKinds([
         ValueKinds.Expression,
         ValueKinds.Generator,
-        ValueKinds.ProblemBuilder,
         ValueKinds.Pattern,
       ]),
       unionOfKinds([
         ValueKinds.Expression,
         ValueKinds.Generator,
-        ValueKinds.ProblemBuilder,
         ValueKinds.Pattern,
       ])
     ]));
@@ -2781,12 +2770,10 @@
       unionOfKinds([
         ValueKinds.Expression,
         ValueKinds.Generator,
-        ValueKinds.ProblemBuilder,
       ]),
       unionOfKinds([
         ValueKinds.Expression,
         ValueKinds.Generator,
-        ValueKinds.ProblemBuilder,
       ]),
     ]));
     Expression right = popForValue();
@@ -2798,10 +2785,6 @@
       if (left is Generator) {
         push(left.buildEqualsOperation(token, right, isNot: isNot));
       } else {
-        if (left is ProblemBuilder) {
-          // Coverage-ignore-block(suite): Not run.
-          left = left.toExpression(libraryBuilder);
-        }
         assert(left is Expression);
         push(forest.createEquals(fileOffset, left as Expression, right,
             isNot: isNot));
@@ -2819,10 +2802,6 @@
       } else if (left is Generator) {
         push(left.buildBinaryOperation(token, name, right));
       } else {
-        if (left is ProblemBuilder) {
-          // Coverage-ignore-block(suite): Not run.
-          left = left.toExpression(libraryBuilder);
-        }
         assert(left is Expression);
         push(forest.createBinary(fileOffset, left as Expression, name, right));
       }
@@ -2838,12 +2817,10 @@
       unionOfKinds([
         ValueKinds.Expression,
         ValueKinds.Generator,
-        ValueKinds.ProblemBuilder,
       ]),
       unionOfKinds([
         ValueKinds.Expression,
         ValueKinds.Generator,
-        ValueKinds.ProblemBuilder,
       ]),
     ]));
     Expression argument = popForValue();
@@ -2867,12 +2844,10 @@
       unionOfKinds([
         ValueKinds.Expression,
         ValueKinds.Generator,
-        ValueKinds.ProblemBuilder,
       ]),
       unionOfKinds([
         ValueKinds.Expression,
         ValueKinds.Generator,
-        ValueKinds.ProblemBuilder,
       ]),
     ]));
     Expression b = popForValue();
@@ -2894,7 +2869,6 @@
       unionOfKinds([
         ValueKinds.Expression,
         ValueKinds.Generator,
-        ValueKinds.ProblemBuilder,
         ValueKinds.Initializer,
       ]),
     ]));
@@ -2926,7 +2900,6 @@
       /* before . or .. */ unionOfKinds([
         ValueKinds.Expression,
         ValueKinds.Generator,
-        ValueKinds.ProblemBuilder,
         ValueKinds.Initializer,
       ]),
     ]));
@@ -3163,7 +3136,6 @@
         ValueKinds.Identifier,
         ValueKinds.Generator,
         ValueKinds.ParserRecovery,
-        ValueKinds.ProblemBuilder,
       ]),
     ]));
   }
@@ -3203,22 +3175,33 @@
   bool isGuardScope(LocalScope scope) =>
       scope.kind == ScopeKind.caseHead || scope.kind == ScopeKind.ifCaseHead;
 
-  /// Look up [name] in [scope] using [nameToken] as location information (both
-  /// to report problems and as the file offset in the generated kernel code).
-  /// [isQualified] should be true if [name] is a qualified access (which
-  /// implies that it shouldn't be turned into a [ThisPropertyAccessGenerator]
-  /// if the name doesn't resolve in the scope).
-  @override
-  Expression_Generator_Builder scopeLookup(LookupScope scope, Token nameToken,
-      {PrefixBuilder? prefix, Token? prefixToken}) {
+  /// Look up the name from [nameToken] in [scope] using [nameToken] as location
+  /// information.
+  Generator scopeLookup(LocalScope scope, Token nameToken) {
     String name = nameToken.lexeme;
     int nameOffset = nameToken.charOffset;
+    LookupResult? lookupResult = scope.lookup(name, fileOffset: nameOffset);
+    return processLookupResult(
+        lookupResult: lookupResult,
+        name: name,
+        nameToken: nameToken,
+        nameOffset: nameOffset,
+        scopeKind: scope.kind);
+  }
+
+  @override
+  Generator processLookupResult(
+      {required LookupResult? lookupResult,
+      required String name,
+      required Token nameToken,
+      required int nameOffset,
+      required ScopeKind scopeKind,
+      PrefixBuilder? prefix,
+      Token? prefixToken}) {
     if (nameToken.isSynthetic) {
       return new ParserErrorGenerator(
           this, nameToken, cfe.messageSyntheticToken);
     }
-
-    LookupResult? lookupResult = scope.lookup(name, nameOffset, uri);
     if (lookupResult != null && lookupResult.isInvalidLookup) {
       return new DuplicateDeclarationGenerator(this, nameToken, lookupResult,
           new Name(name, libraryBuilder.nameOrigin), name.length);
@@ -3276,9 +3259,8 @@
     Builder? getable = lookupResult.getable;
     Builder? setable = lookupResult.setable;
     if (getable != null) {
-      if (getable is ProblemBuilder) {
-        return getable;
-      } else if (getable is InvalidBuilder) {
+      if (getable is InvalidBuilder) {
+        // TODO(johnniwinther): Create an `InvalidGenerator` instead.
         return new TypeUseGenerator(
             this,
             nameToken,
@@ -3298,14 +3280,14 @@
         VariableDeclaration variable = getable.variable!;
         // TODO(johnniwinther): The handling of for-in variables should be
         //  done through the builder.
-        if (scope.kind == ScopeKind.forStatement &&
+        if (scopeKind == ScopeKind.forStatement &&
             variable.isAssignable &&
             variable.isLate &&
             variable.isFinal) {
           return new ForInLateFinalVariableUseGenerator(
               this, nameToken, variable);
         } else if (!getable.isAssignable ||
-            (variable.isFinal && scope.kind == ScopeKind.forStatement)) {
+            (variable.isFinal && scopeKind == ScopeKind.forStatement)) {
           return _createReadOnlyVariableAccess(
               variable,
               nameToken,
@@ -3391,11 +3373,6 @@
                     prefixToken.charOffset, name, nameOffset)
                 : new IdentifierTypeName(name, nameOffset));
       } else if (getable is MemberBuilder) {
-        if (setable is AmbiguousBuilder) {
-          // TODO(johnniwinther): Handle this. Currently we report unresolved
-          // setter instead of ambiguous setter here.
-          setable = null;
-        }
         assert(getable.isStatic || getable.isTopLevel,
             "Unexpected getable: $getable");
         assert(
@@ -3428,9 +3405,7 @@
         return new LoadLibraryGenerator(this, nameToken, getable);
       }
     } else {
-      if (setable is ProblemBuilder) {
-        return setable;
-      } else if (setable is InvalidBuilder) {
+      if (setable is InvalidBuilder) {
         // Coverage-ignore-block(suite): Not run.
         return new TypeUseGenerator(
             this,
@@ -3510,7 +3485,6 @@
       /* suffix */ ValueKinds.IdentifierOrParserRecovery,
       /* prefix */ unionOfKinds([
         ValueKinds.Generator,
-        ValueKinds.ProblemBuilder,
       ]),
     ]));
 
@@ -3709,7 +3683,6 @@
     assert(checkState(when, [
       unionOfKinds([
         ValueKinds.Expression,
-        ValueKinds.ProblemBuilder,
         ValueKinds.Pattern,
       ])
     ]));
@@ -4072,13 +4045,10 @@
       unionOfKinds(<ValueKind>[
         ValueKinds.Expression,
         ValueKinds.Generator,
-        // TODO(johnniwinther): Avoid problem builders here.
-        ValueKinds.ProblemBuilder
       ]),
       unionOfKinds(<ValueKind>[
-        ValueKinds.Expression, ValueKinds.Generator,
-        // TODO(johnniwinther): Avoid problem builders here.
-        ValueKinds.ProblemBuilder
+        ValueKinds.Expression,
+        ValueKinds.Generator,
       ])
     ]));
     debugEvent("AssignmentExpression");
@@ -4194,12 +4164,10 @@
       unionOfKinds([
         ValueKinds.Expression,
         ValueKinds.Generator,
-        ValueKinds.ProblemBuilder,
       ]),
       unionOfKinds([
         ValueKinds.Expression,
         ValueKinds.Generator,
-        ValueKinds.ProblemBuilder,
         ValueKinds.Pattern,
       ]),
     ]));
@@ -4510,7 +4478,6 @@
           unionOfKinds([
             ValueKinds.Generator,
             ValueKinds.Expression,
-            ValueKinds.ProblemBuilder,
           ]),
           count),
       ValueKinds.TypeArgumentsOrNull,
@@ -4562,7 +4529,6 @@
           unionOfKinds([
             ValueKinds.Generator,
             ValueKinds.Expression,
-            ValueKinds.ProblemBuilder,
             ValueKinds.Pattern,
           ]),
           count),
@@ -4607,7 +4573,6 @@
             unionOfKinds([
               ValueKinds.Generator,
               ValueKinds.Expression,
-              ValueKinds.ProblemBuilder,
               ValueKinds.NamedExpression,
               ValueKinds.ParserRecovery,
             ]),
@@ -4701,7 +4666,6 @@
             unionOfKinds([
               ValueKinds.Generator,
               ValueKinds.Expression,
-              ValueKinds.ProblemBuilder,
               ValueKinds.NamedExpression,
               ValueKinds.Pattern,
             ]),
@@ -4771,7 +4735,6 @@
           unionOfKinds([
             ValueKinds.Expression,
             ValueKinds.Generator,
-            ValueKinds.ProblemBuilder,
             ValueKinds.MapLiteralEntry,
           ]),
           count),
@@ -4846,13 +4809,11 @@
       /* value */ unionOfKinds([
         ValueKinds.Expression,
         ValueKinds.Generator,
-        ValueKinds.ProblemBuilder,
         ValueKinds.Pattern,
       ]),
       /* key */ unionOfKinds([
         ValueKinds.Expression,
         ValueKinds.Generator,
-        ValueKinds.ProblemBuilder,
       ])
     ]));
     Pattern value = toPattern(pop());
@@ -5052,7 +5013,6 @@
         ValueKinds.Expression,
         ValueKinds.Generator,
         ValueKinds.Initializer,
-        ValueKinds.ProblemBuilder
       ])
     ]));
     Expression operand = popForValue();
@@ -5068,7 +5028,6 @@
       unionOfKinds([
         ValueKinds.QualifiedName,
         ValueKinds.Generator,
-        ValueKinds.ProblemBuilder,
       ]),
     ]));
 
@@ -5132,16 +5091,6 @@
           arguments,
           allowPotentiallyConstantType: allowPotentiallyConstantType,
           performTypeCanonicalization: constantContext != ConstantContext.none);
-    }
-    // Coverage-ignore(suite): Not run.
-    else if (name is ProblemBuilder) {
-      result = new NamedTypeBuilderImpl.forInvalidType(
-          name.name,
-          isMarkedAsNullable
-              ? const NullabilityBuilder.nullable()
-              : const NullabilityBuilder.omitted(),
-          name.message
-              .withLocation(name.fileUri, name.fileOffset, name.name.length));
     } else {
       unhandled(
           "${name.runtimeType}", "handleType", beginToken.charOffset, uri);
@@ -5343,7 +5292,6 @@
       unionOfKinds([
         ValueKinds.Expression,
         ValueKinds.Generator,
-        ValueKinds.ProblemBuilder,
       ]),
     ]));
     DartType type = buildDartType(pop() as TypeBuilder, TypeUse.asType,
@@ -5362,7 +5310,6 @@
       unionOfKinds([
         ValueKinds.Expression,
         ValueKinds.Generator,
-        ValueKinds.ProblemBuilder,
         ValueKinds.Pattern,
       ]),
     ]));
@@ -5935,7 +5882,6 @@
       unionOfKinds(<ValueKind>[
         ValueKinds.Expression,
         ValueKinds.Generator,
-        ValueKinds.ProblemBuilder
       ]),
     ]));
     debugEvent("UnaryPrefixExpression");
@@ -6045,7 +5991,6 @@
       /*type*/ unionOfKinds([
         ValueKinds.Generator,
         ValueKinds.QualifiedName,
-        ValueKinds.ProblemBuilder,
         ValueKinds.ParserRecovery
       ]),
     ]));
@@ -6094,14 +6039,6 @@
           }
         // Coverage-ignore(suite): Not run.
         case QualifiedNameBuilder():
-          Builder qualifier = qualified.qualifier;
-          if (qualifier is ProblemBuilder) {
-            type = qualifier;
-          } else {
-            unhandled("${qualifier.runtimeType}", "pushQualifiedReference",
-                start.charOffset, uri);
-          }
-        // Coverage-ignore(suite): Not run.
         case QualifiedNameIdentifier():
           unhandled("${qualified.runtimeType}", "pushQualifiedReference",
               start.charOffset, uri);
@@ -6132,7 +6069,6 @@
       /*type arguments*/ ValueKinds.TypeArgumentsOrNull,
       /*class*/ unionOfKinds([
         ValueKinds.Generator,
-        ValueKinds.ProblemBuilder,
         ValueKinds.ParserRecovery,
         ValueKinds.Expression,
       ]),
@@ -6463,7 +6399,6 @@
       /*type arguments*/ ValueKinds.TypeArgumentsOrNull,
       /*class*/ unionOfKinds([
         ValueKinds.Generator,
-        ValueKinds.ProblemBuilder,
         ValueKinds.ParserRecovery,
         ValueKinds.Expression,
       ]),
@@ -6508,9 +6443,6 @@
     } else {
       // Coverage-ignore-block(suite): Not run.
       String? typeName;
-      if (type is ProblemBuilder) {
-        typeName = type.fullNameForErrors;
-      }
       push(buildUnresolvedError(
           debugName(typeName!, name), nameLastToken.charOffset,
           arguments: arguments, kind: UnresolvedKind.Constructor));
@@ -7048,7 +6980,6 @@
       unionOfKinds([
         ValueKinds.Expression,
         ValueKinds.Generator,
-        ValueKinds.ProblemBuilder,
         ValueKinds.MapLiteralEntry,
       ]),
       ValueKinds.Condition,
@@ -7076,7 +7007,6 @@
       unionOfKinds([
         ValueKinds.Expression,
         ValueKinds.Generator,
-        ValueKinds.ProblemBuilder,
         ValueKinds.MapLiteralEntry,
       ]),
       ValueKinds.Condition,
@@ -7126,13 +7056,11 @@
       /* else element */ unionOfKinds([
         ValueKinds.Expression,
         ValueKinds.Generator,
-        ValueKinds.ProblemBuilder,
         ValueKinds.MapLiteralEntry,
       ]),
       /* then element */ unionOfKinds([
         ValueKinds.Expression,
         ValueKinds.Generator,
-        ValueKinds.ProblemBuilder,
         ValueKinds.MapLiteralEntry,
       ]),
       ValueKinds.AssignedVariablesNodeInfo,
@@ -7691,12 +7619,10 @@
       unionOfKinds([
         ValueKinds.Expression,
         ValueKinds.Generator,
-        ValueKinds.ProblemBuilder,
       ]),
       unionOfKinds([
         ValueKinds.Expression,
         ValueKinds.Generator,
-        ValueKinds.ProblemBuilder,
         ValueKinds.Pattern,
         ValueKinds.Statement, // Variable for non-pattern for-in loop.
         ValueKinds.ParserRecovery,
@@ -7842,9 +7768,6 @@
       } else if (lvalue is InvalidExpression) {
         // Coverage-ignore-block(suite): Not run.
         elements.expressionProblem = lvalue;
-      } else if (lvalue is AmbiguousBuilder) {
-        // Coverage-ignore-block(suite): Not run.
-        elements.expressionProblem = toValue(lvalue);
       } else if (lvalue is ParserRecovery) {
         elements.expressionProblem = buildProblem(
             cfe.messageSyntheticToken, lvalue.charOffset, noLength);
@@ -7890,12 +7813,10 @@
       /* expression = */ unionOfKinds([
         ValueKinds.Expression,
         ValueKinds.Generator,
-        ValueKinds.ProblemBuilder,
       ]),
       /* lvalue = */ unionOfKinds([
         ValueKinds.Expression,
         ValueKinds.Generator,
-        ValueKinds.ProblemBuilder,
         ValueKinds.Pattern,
         ValueKinds.Statement,
         ValueKinds.ParserRecovery,
@@ -8389,7 +8310,6 @@
       unionOfKinds([
         ValueKinds.Expression,
         ValueKinds.Generator,
-        ValueKinds.ProblemBuilder,
         ValueKinds.Pattern,
       ]),
       ValueKinds.ConstantContext,
@@ -8411,11 +8331,7 @@
   void endSwitchCaseWhenClause(Token token) {
     debugEvent("SwitchCaseWhenClause");
     assert(checkState(token, [
-      unionOfKinds([
-        ValueKinds.Expression,
-        ValueKinds.ProblemBuilder,
-        ValueKinds.Generator
-      ]),
+      unionOfKinds([ValueKinds.Expression, ValueKinds.Generator]),
       ValueKinds.ConstantContext,
     ]));
     Object? guard = pop();
@@ -8430,7 +8346,6 @@
       unionOfKinds([
         ValueKinds.Expression,
         ValueKinds.Generator,
-        ValueKinds.ProblemBuilder,
         ValueKinds.Pattern,
       ])
     ]));
@@ -8700,12 +8615,8 @@
   void handleSwitchExpressionCasePattern(Token token) {
     debugEvent("SwitchExpressionCasePattern");
     assert(checkState(token, [
-      unionOfKinds([
-        ValueKinds.Expression,
-        ValueKinds.Generator,
-        ValueKinds.ProblemBuilder,
-        ValueKinds.Pattern
-      ])
+      unionOfKinds(
+          [ValueKinds.Expression, ValueKinds.Generator, ValueKinds.Pattern])
     ]));
     Object? pattern = pop();
     createAndEnterLocalScope(
@@ -8726,18 +8637,15 @@
       unionOfKinds([
         ValueKinds.Expression,
         ValueKinds.Generator,
-        ValueKinds.ProblemBuilder,
       ]),
       if (when != null)
         unionOfKinds([
           ValueKinds.Expression,
           ValueKinds.Generator,
-          ValueKinds.ProblemBuilder,
         ]),
       unionOfKinds([
         ValueKinds.Expression,
         ValueKinds.Generator,
-        ValueKinds.ProblemBuilder,
         ValueKinds.Pattern,
       ]),
     ]));
@@ -9754,7 +9662,6 @@
       unionOfKinds([
         ValueKinds.Expression,
         ValueKinds.Generator,
-        ValueKinds.ProblemBuilder,
       ]),
       ValueKinds.ConstantContext,
     ]));
@@ -9772,7 +9679,6 @@
             unionOfKinds([
               ValueKinds.Expression,
               ValueKinds.Generator,
-              ValueKinds.ProblemBuilder,
               ValueKinds.Pattern,
             ]),
             count)));
@@ -9842,7 +9748,6 @@
         unionOfKinds([
           ValueKinds.Expression,
           ValueKinds.Generator,
-          ValueKinds.ProblemBuilder,
           ValueKinds.Pattern,
         ]),
     ]));
@@ -9861,7 +9766,6 @@
       unionOfKinds([
         ValueKinds.Expression,
         ValueKinds.Generator,
-        ValueKinds.ProblemBuilder,
         ValueKinds.Pattern,
       ]),
     ]));
@@ -9907,7 +9811,6 @@
       unionOfKinds([
         ValueKinds.Expression,
         ValueKinds.Generator,
-        ValueKinds.ProblemBuilder,
         ValueKinds.Pattern,
       ]),
     ]));
@@ -9924,7 +9827,6 @@
       unionOfKinds([
         ValueKinds.Expression,
         ValueKinds.Generator,
-        ValueKinds.ProblemBuilder,
         ValueKinds.Pattern,
       ]),
     ]));
@@ -9942,7 +9844,8 @@
         libraryFeatures.patterns, variable.charOffset, variable.charCount);
     assert(variable.lexeme != '_');
     Pattern pattern;
-    Expression variableUse = toValue(scopeLookup(_localScope, variable));
+    Expression variableUse =
+        scopeLookup(_localScope, variable).buildSimpleRead();
     if (variableUse is VariableGet) {
       VariableDeclaration variableDeclaration = variableUse.variable;
       pattern = forest.createAssignedVariablePattern(
@@ -10014,7 +9917,6 @@
       unionOfKinds([
         ValueKinds.Expression,
         ValueKinds.Generator,
-        ValueKinds.ProblemBuilder,
         ValueKinds.Pattern,
       ]),
       if (colon != null)
@@ -10056,14 +9958,9 @@
       unionOfKinds([
         ValueKinds.Expression,
         ValueKinds.Generator,
-        ValueKinds.ProblemBuilder,
       ]),
-      unionOfKinds([
-        ValueKinds.Expression,
-        ValueKinds.Generator,
-        ValueKinds.ProblemBuilder,
-        ValueKinds.Pattern
-      ]),
+      unionOfKinds(
+          [ValueKinds.Expression, ValueKinds.Generator, ValueKinds.Pattern]),
       ValueKinds.AnnotationListOrNull,
     ]));
     Expression initializer = popForValue();
@@ -10088,13 +9985,11 @@
       unionOfKinds([
         ValueKinds.Expression,
         ValueKinds.Generator,
-        ValueKinds.ProblemBuilder,
       ]),
       unionOfKinds([
         ValueKinds.Pattern,
         ValueKinds.Expression,
         ValueKinds.Generator,
-        ValueKinds.ProblemBuilder,
       ]),
     ]));
     Expression expression = popForValue();
@@ -10674,14 +10569,3 @@
     }
   }
 }
-
-// Coverage-ignore(suite): Not run.
-extension on ProblemBuilder {
-  Expression toExpression(SourceLibraryBuilder libraryBuilder) {
-    String text = libraryBuilder.loader.target.context
-        .format(
-            message.withLocation(fileUri, fileOffset, noLength), Severity.error)
-        .plain;
-    return new InvalidExpression(text)..fileOffset = fileOffset;
-  }
-}
diff --git a/pkg/front_end/lib/src/kernel/expression_generator.dart b/pkg/front_end/lib/src/kernel/expression_generator.dart
index ab15fe6..60356d8 100644
--- a/pkg/front_end/lib/src/kernel/expression_generator.dart
+++ b/pkg/front_end/lib/src/kernel/expression_generator.dart
@@ -35,7 +35,6 @@
 import '../base/constant_context.dart' show ConstantContext;
 import '../base/lookup_result.dart';
 import '../base/problems.dart';
-import '../base/scope.dart';
 import '../builder/builder.dart';
 import '../builder/declaration_builders.dart';
 import '../builder/factory_builder.dart';
@@ -3383,11 +3382,7 @@
         Builder? getable = result.getable;
         Builder? setable = result.setable;
         if (getable != null) {
-          if (getable is AmbiguousBuilder) {
-            // Coverage-ignore-block(suite): Not run.
-            return _helper.buildProblem(
-                getable.message, getable.fileOffset, name.text.length);
-          } else if (getable.isStatic &&
+          if (getable.isStatic &&
               getable is! FactoryBuilder &&
               typeArguments != null) {
             return _helper.buildProblem(
@@ -3405,20 +3400,14 @@
                 isNullAware: isNullAware);
           }
         } else {
-          if (setable is AmbiguousBuilder) {
-            // Coverage-ignore-block(suite): Not run.
-            return _helper.buildProblem(
-                setable.message, setable.fileOffset, name.text.length);
-          } else {
-            generator = new StaticAccessGenerator.fromBuilder(
-                _helper,
-                name.text,
-                send.token,
-                getable is MemberBuilder ? getable : null,
-                setable is MemberBuilder ? setable : null,
-                typeOffset: fileOffset,
-                isNullAware: isNullAware);
-          }
+          generator = new StaticAccessGenerator.fromBuilder(
+              _helper,
+              name.text,
+              send.token,
+              getable is MemberBuilder ? getable : null,
+              setable is MemberBuilder ? setable : null,
+              typeOffset: fileOffset,
+              isNullAware: isNullAware);
         }
       }
 
@@ -4240,7 +4229,7 @@
   }
 
   @override
-  /* Expression | Generator */ Object qualifiedLookup(Token nameToken) {
+  Generator qualifiedLookup(Token nameToken) {
     if (_helper.constantContext != ConstantContext.none && prefix.deferred) {
       // Coverage-ignore-block(suite): Not run.
       _helper.addProblem(
@@ -4248,17 +4237,19 @@
           fileOffset,
           lengthForToken(token));
     }
-    Object result = _helper.scopeLookup(prefix.prefixScope, nameToken,
-        prefix: prefix, prefixToken: token);
+    String name = nameToken.lexeme;
+    Generator result = _helper.processLookupResult(
+        lookupResult: prefix.prefixScope.lookup(name),
+        name: name,
+        nameToken: nameToken,
+        nameOffset: nameToken.charOffset,
+        scopeKind: prefix.prefixScope.kind,
+        prefix: prefix,
+        prefixToken: token);
+
     if (prefix.deferred) {
-      if (result is Generator) {
-        if (result is! LoadLibraryGenerator) {
-          result =
-              new DeferredAccessGenerator(_helper, nameToken, this, result);
-        }
-      } else {
-        // Coverage-ignore-block(suite): Not run.
-        _helper.wrapInDeferredCheck(result as Expression, prefix, fileOffset);
+      if (result is! LoadLibraryGenerator) {
+        result = new DeferredAccessGenerator(_helper, nameToken, this, result);
       }
     }
     return result;
diff --git a/pkg/front_end/lib/src/kernel/expression_generator_helper.dart b/pkg/front_end/lib/src/kernel/expression_generator_helper.dart
index 3624b82..13a17dc 100644
--- a/pkg/front_end/lib/src/kernel/expression_generator_helper.dart
+++ b/pkg/front_end/lib/src/kernel/expression_generator_helper.dart
@@ -23,6 +23,7 @@
 import '../source/source_library_builder.dart' show SourceLibraryBuilder;
 import '../type_inference/inference_helper.dart' show InferenceHelper;
 import 'constness.dart' show Constness;
+import 'expression_generator.dart';
 import 'forest.dart' show Forest;
 import 'internal_ast.dart';
 
@@ -62,8 +63,14 @@
 
   bool isDeclaredInEnclosingCase(VariableDeclaration variable);
 
-  Expression_Generator_Builder scopeLookup(LookupScope scope, Token nameToken,
-      {PrefixBuilder? prefix, Token? prefixToken});
+  Generator processLookupResult(
+      {required LookupResult? lookupResult,
+      required String name,
+      required Token nameToken,
+      required int nameOffset,
+      required ScopeKind scopeKind,
+      PrefixBuilder? prefix,
+      Token? prefixToken});
 
   Expression_Generator_Initializer finishSend(Object receiver,
       List<TypeBuilder>? typeArguments, ArgumentsImpl arguments, int offset,
diff --git a/pkg/front_end/lib/src/kernel/kernel_target.dart b/pkg/front_end/lib/src/kernel/kernel_target.dart
index ca5a80e..bbd4d4b 100644
--- a/pkg/front_end/lib/src/kernel/kernel_target.dart
+++ b/pkg/front_end/lib/src/kernel/kernel_target.dart
@@ -42,7 +42,6 @@
         templateMissingImplementationCause,
         templateSuperclassHasNoDefaultConstructor;
 import '../base/processed_options.dart' show ProcessedOptions;
-import '../base/scope.dart' show AmbiguousBuilder;
 import '../base/ticker.dart' show Ticker;
 import '../base/uri_offset.dart';
 import '../base/uri_translator.dart' show UriTranslator;
@@ -768,13 +767,7 @@
     LibraryBuilder? firstRoot = loader.rootLibrary;
     if (firstRoot != null) {
       // TODO(sigmund): do only for full program
-      Builder? declaration =
-          firstRoot.exportNameSpace.lookupLocalMember("main")?.getable;
-      if (declaration is AmbiguousBuilder) {
-        // Coverage-ignore-block(suite): Not run.
-        AmbiguousBuilder problem = declaration;
-        declaration = problem.getFirstDeclaration();
-      }
+      Builder? declaration = firstRoot.exportNameSpace.lookup("main")?.getable;
       if (declaration is MethodBuilder) {
         mainReference = declaration.invokeTargetReference;
       }
diff --git a/pkg/front_end/lib/src/kernel/macro/metadata.dart b/pkg/front_end/lib/src/kernel/macro/metadata.dart
index cd595e6..6e49a12 100644
--- a/pkg/front_end/lib/src/kernel/macro/metadata.dart
+++ b/pkg/front_end/lib/src/kernel/macro/metadata.dart
@@ -168,9 +168,7 @@
 
   @override
   shared.Proto lookup(String name) {
-    int fileOffset = -1;
-    Uri fileUri = dummyUri;
-    Builder? builder = scope.lookup(name, fileOffset, fileUri)?.getable;
+    Builder? builder = scope.lookup(name)?.getable;
     if (builder == null) {
       return new shared.UnresolvedIdentifier(this, name);
     } else {
@@ -322,9 +320,7 @@
 
   @override
   shared.Proto lookup(String name) {
-    int fileOffset = -1;
-    Uri fileUri = dummyUri;
-    Builder? builder = prefixBuilder.lookup(name, fileOffset, fileUri)?.getable;
+    Builder? builder = prefixBuilder.lookup(name)?.getable;
     if (builder == null) {
       return new shared.UnresolvedIdentifier(this, name);
     } else {
diff --git a/pkg/front_end/lib/src/kernel/utils.dart b/pkg/front_end/lib/src/kernel/utils.dart
index c984c86..885b1be 100644
--- a/pkg/front_end/lib/src/kernel/utils.dart
+++ b/pkg/front_end/lib/src/kernel/utils.dart
@@ -312,5 +312,5 @@
   ScopeKind get kind => ScopeKind.library;
 
   @override
-  LookupResult? lookup(String name, int fileOffset, Uri fileUri) => null;
+  LookupResult? lookup(String name) => null;
 }
diff --git a/pkg/front_end/lib/src/source/source_class_builder.dart b/pkg/front_end/lib/src/source/source_class_builder.dart
index 9175e4f..fecba4f 100644
--- a/pkg/front_end/lib/src/source/source_class_builder.dart
+++ b/pkg/front_end/lib/src/source/source_class_builder.dart
@@ -725,7 +725,7 @@
 
       if (hasEnumSuperinterface && cls != underscoreEnumClass) {
         // Instance members named `values` are restricted.
-        LookupResult? result = nameSpace.lookupLocalMember("values");
+        LookupResult? result = nameSpace.lookup("values");
         NamedBuilder? customValuesDeclaration = result?.getable;
         if (customValuesDeclaration != null &&
             !customValuesDeclaration.isStatic) {
@@ -788,8 +788,7 @@
         // Non-setter concrete instance members named `index` and hashCode and
         // operator == are restricted.
         for (String restrictedMemberName in restrictedNames) {
-          Builder? member =
-              nameSpace.lookupLocalMember(restrictedMemberName)?.getable;
+          Builder? member = nameSpace.lookup(restrictedMemberName)?.getable;
           if (member is MemberBuilder &&
               (member is PropertyBuilder && !member.hasAbstractGetter ||
                   member is MethodBuilder && !member.isAbstract)) {
diff --git a/pkg/front_end/lib/src/source/source_compilation_unit.dart b/pkg/front_end/lib/src/source/source_compilation_unit.dart
index 6813dac..ca89c18 100644
--- a/pkg/front_end/lib/src/source/source_compilation_unit.dart
+++ b/pkg/front_end/lib/src/source/source_compilation_unit.dart
@@ -1024,7 +1024,7 @@
       required NamedBuilder builder,
       required int charOffset}) {
     bool isSetter = isMappedAsSetter(builder);
-    LookupResult? result = _importNameSpace.lookupLocalMember(name);
+    LookupResult? result = _importNameSpace.lookup(name);
 
     NamedBuilder? existing = isSetter ? result?.setable : result?.getable;
     if (existing != null) {
@@ -1187,9 +1187,8 @@
   @override
   bool addPrefixFragment(
       String name, PrefixFragment prefixFragment, int charOffset) {
-    Builder? existing = prefixNameSpace.lookupLocalMember(name)?.getable;
-    existing ??=
-        libraryBuilder.libraryNameSpace.lookupLocalMember(name)?.getable;
+    Builder? existing = prefixNameSpace.lookup(name)?.getable;
+    existing ??= libraryBuilder.libraryNameSpace.lookup(name)?.getable;
     if (existing is PrefixBuilder) {
       assert(existing.next is! PrefixBuilder);
       int? deferredFileOffset;
diff --git a/pkg/front_end/lib/src/source/source_enum_builder.dart b/pkg/front_end/lib/src/source/source_enum_builder.dart
index f127882..1c7ab59 100644
--- a/pkg/front_end/lib/src/source/source_enum_builder.dart
+++ b/pkg/front_end/lib/src/source/source_enum_builder.dart
@@ -214,7 +214,7 @@
       "=="
     ]) {
       NamedBuilder? customIndexDeclaration =
-          nameSpace.lookupLocalMember(restrictedInstanceMemberName)?.getable;
+          nameSpace.lookup(restrictedInstanceMemberName)?.getable;
       NamedBuilder? invalidDeclaration;
       if (customIndexDeclaration is PropertyBuilder &&
           !customIndexDeclaration.hasAbstractGetter &&
diff --git a/pkg/front_end/lib/src/source/source_library_builder.dart b/pkg/front_end/lib/src/source/source_library_builder.dart
index 8dcff8f..07029e0 100644
--- a/pkg/front_end/lib/src/source/source_library_builder.dart
+++ b/pkg/front_end/lib/src/source/source_library_builder.dart
@@ -364,7 +364,7 @@
     if (name.startsWith("_")) return false;
     if (member is PrefixBuilder) return false;
     bool isSetter = isMappedAsSetter(member);
-    LookupResult? result = exportNameSpace.lookupLocalMember(name);
+    LookupResult? result = exportNameSpace.lookup(name);
     NamedBuilder? existing = isSetter ? result?.setable : result?.getable;
     if (existing == member) {
       return false;
@@ -404,7 +404,7 @@
     NamedBuilder? preferred;
     Uri? uri;
     Uri? otherUri;
-    if (libraryNameSpace.lookupLocalMember(name)?.getable == declaration) {
+    if (libraryNameSpace.lookup(name)?.getable == declaration) {
       return declaration;
     } else {
       uri = computeLibraryUri(declaration);
@@ -824,19 +824,19 @@
   void becomeCoreLibrary() {
     assert(checkState(required: [SourceLibraryBuilderState.nameSpaceBuilt]));
 
-    if (libraryNameSpace.lookupLocalMember("dynamic")?.getable == null) {
+    if (libraryNameSpace.lookup("dynamic")?.getable == null) {
       DynamicTypeDeclarationBuilder builder =
           new DynamicTypeDeclarationBuilder(const DynamicType(), this, -1);
       _libraryNameSpace!.addLocalMember("dynamic", builder);
       _memberBuilders.add(builder);
     }
-    if (libraryNameSpace.lookupLocalMember("Never")?.getable == null) {
+    if (libraryNameSpace.lookup("Never")?.getable == null) {
       NeverTypeDeclarationBuilder builder = new NeverTypeDeclarationBuilder(
           const NeverType.nonNullable(), this, -1);
       _libraryNameSpace!.addLocalMember("Never", builder);
       _memberBuilders.add(builder);
     }
-    assert(libraryNameSpace.lookupLocalMember("Null")?.getable != null,
+    assert(libraryNameSpace.lookup("Null")?.getable != null,
         "No class 'Null' found in dart:core.");
   }
 
diff --git a/pkg/front_end/lib/src/source/source_loader.dart b/pkg/front_end/lib/src/source/source_loader.dart
index 7c4e863..0a2ec26 100644
--- a/pkg/front_end/lib/src/source/source_loader.dart
+++ b/pkg/front_end/lib/src/source/source_loader.dart
@@ -1259,9 +1259,7 @@
 
     DeclarationBuilder? declarationBuilder;
     if (enclosingClassOrExtension != null) {
-      Builder? builder = memberScope
-          .lookup(enclosingClassOrExtension, -1, libraryBuilder.fileUri)
-          ?.getable;
+      Builder? builder = memberScope.lookup(enclosingClassOrExtension)?.getable;
       if (builder is TypeDeclarationBuilder) {
         switch (builder) {
           case ClassBuilder():
@@ -2605,8 +2603,7 @@
 
   void _checkMainMethods(
       SourceLibraryBuilder libraryBuilder, DartType listOfString) {
-    LookupResult? result =
-        libraryBuilder.exportNameSpace.lookupLocalMember('main');
+    LookupResult? result = libraryBuilder.exportNameSpace.lookup('main');
     Builder? mainBuilder = result?.getable;
     mainBuilder ??= result?.setable;
     if (mainBuilder is MemberBuilder) {
diff --git a/pkg/front_end/lib/src/source/source_property_builder.dart b/pkg/front_end/lib/src/source/source_property_builder.dart
index ffc03a9..c65c989 100644
--- a/pkg/front_end/lib/src/source/source_property_builder.dart
+++ b/pkg/front_end/lib/src/source/source_property_builder.dart
@@ -243,8 +243,7 @@
     if (!isClassMember) {
       // Getter/setter type conflict for class members is handled in the class
       // hierarchy builder.
-      setterBuilder =
-          nameSpace.lookupLocalMember(name)?.setable as SourcePropertyBuilder?;
+      setterBuilder = nameSpace.lookup(name)?.setable as SourcePropertyBuilder?;
     }
     _introductoryField?.checkFieldTypes(
         library, typeEnvironment, setterBuilder);
diff --git a/pkg/front_end/lib/src/source/value_kinds.dart b/pkg/front_end/lib/src/source/value_kinds.dart
index 3c2ba2b..f0e411b 100644
--- a/pkg/front_end/lib/src/source/value_kinds.dart
+++ b/pkg/front_end/lib/src/source/value_kinds.dart
@@ -21,7 +21,6 @@
 import '../base/identifiers.dart' as type;
 import '../base/modifiers.dart' as type;
 import '../base/operator.dart' as type;
-import '../base/scope.dart' as type;
 import '../builder/constructor_reference_builder.dart' as type;
 import '../builder/declaration_builders.dart' as type;
 import '../builder/formal_parameter_builder.dart' as type;
@@ -162,8 +161,6 @@
       const SingleValueKind<List<type.Operator>>(NullValues.OperatorList);
   static const ValueKind ParserRecovery =
       const SingleValueKind<type.ParserRecovery>();
-  static const ValueKind ProblemBuilder =
-      const SingleValueKind<type.ProblemBuilder>();
   static const ValueKind QualifiedName =
       const SingleValueKind<type.QualifiedName>();
   static const ValueKind RecordTypeFieldBuilder =
diff --git a/pkg/front_end/lib/src/testing/id_testing_utils.dart b/pkg/front_end/lib/src/testing/id_testing_utils.dart
index 44a3700..c33931c 100644
--- a/pkg/front_end/lib/src/testing/id_testing_utils.dart
+++ b/pkg/front_end/lib/src/testing/id_testing_utils.dart
@@ -163,7 +163,7 @@
       compilerResult, cls.enclosingLibrary,
       required: required)!;
   ClassBuilder? clsBuilder = libraryBuilder.libraryNameSpace
-      .lookupLocalMember(cls.name)
+      .lookup(cls.name)
       ?.getable as ClassBuilder?;
   if (clsBuilder == null && required) {
     throw new ArgumentError("ClassBuilder for $cls not found.");
@@ -199,7 +199,7 @@
       required: required)!;
   ExtensionTypeDeclarationBuilder? extensionTypeDeclarationBuilder;
   Builder? builder = libraryBuilder.libraryNameSpace
-      .lookupLocalMember(extensionTypeDeclaration.name)
+      .lookup(extensionTypeDeclaration.name)
       ?.getable;
   if (builder is ExtensionTypeDeclarationBuilder &&
       builder.extensionTypeDeclaration == extensionTypeDeclaration) {
@@ -227,8 +227,7 @@
           classBuilder.nameSpace.lookupConstructor(memberName)?.getable;
     } else {
       bool isSetter = member is Procedure && member.isSetter;
-      LookupResult? result =
-          classBuilder.nameSpace.lookupLocalMember(memberName);
+      LookupResult? result = classBuilder.nameSpace.lookup(memberName);
       memberBuilder =
           (isSetter ? result?.setable : result?.getable) as MemberBuilder?;
     }
@@ -291,7 +290,7 @@
         required: required)!;
     bool isSetter = member is Procedure && member.isSetter;
     LookupResult? result =
-        libraryBuilder.libraryNameSpace.lookupLocalMember(member.name.text);
+        libraryBuilder.libraryNameSpace.lookup(member.name.text);
     memberBuilder =
         (isSetter ? result?.setable : result?.getable) as MemberBuilder?;
   }
@@ -315,8 +314,7 @@
   MemberBuilder? memberBuilder;
   if (extensionBuilder != null) {
     bool isSetter = member is Procedure && member.isSetter;
-    LookupResult? result =
-        extensionBuilder.nameSpace.lookupLocalMember(memberName);
+    LookupResult? result = extensionBuilder.nameSpace.lookup(memberName);
     memberBuilder =
         (isSetter ? result?.setable : result?.getable) as MemberBuilder?;
   }
@@ -346,8 +344,7 @@
           extensionTypeBuilder.nameSpace.lookupConstructor(memberName)?.getable;
     } else {
       bool isSetter = member is Procedure && member.isSetter;
-      LookupResult? result =
-          extensionTypeBuilder.nameSpace.lookupLocalMember(memberName);
+      LookupResult? result = extensionTypeBuilder.nameSpace.lookup(memberName);
       memberBuilder =
           (isSetter ? result?.setable : result?.getable) as MemberBuilder?;
     }
diff --git a/pkg/front_end/parser_testcases/also-nnbd/issue_39326.dart.intertwined.expect b/pkg/front_end/parser_testcases/also-nnbd/issue_39326.dart.intertwined.expect
index 076ce3c..456c8b3 100644
--- a/pkg/front_end/parser_testcases/also-nnbd/issue_39326.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/also-nnbd/issue_39326.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
@@ -45,7 +45,7 @@
                     listener: endInitializedIdentifier(c)
                   ensureSemicolon(c)
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, c)
+          notEofOrType(CLOSE_CURLY_BRACKET, c)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -57,7 +57,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(c, expression)
                               listener: handleNoTypeArguments(?.)
@@ -83,7 +82,7 @@
                       listener: handleAssignmentExpression(=, 42)
                   ensureSemicolon(42)
                   listener: handleExpressionStatement(c, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/also-nnbd/issue_40267_conditional.dart.intertwined.expect b/pkg/front_end/parser_testcases/also-nnbd/issue_40267_conditional.dart.intertwined.expect
index a37b754..9464764 100644
--- a/pkg/front_end/parser_testcases/also-nnbd/issue_40267_conditional.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/also-nnbd/issue_40267_conditional.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
@@ -59,7 +59,7 @@
                     listener: endInitializedIdentifier(c)
                   ensureSemicolon(c)
                   listener: endVariablesDeclaration(3, ;)
-          notEofOrValue(}, a)
+          notEofOrType(CLOSE_CURLY_BRACKET, a)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -71,7 +71,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(a, expression)
                               listener: handleNoTypeArguments(?)
@@ -90,7 +89,6 @@
                                         parsePrimary([, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                             parseSend([, expression, ConstantPatternContext.none)
-                                              isNextIdentifier([)
                                               ensureIdentifier([, expression)
                                               parseArgumentsOpt(b)
                         parseExpressionWithoutCascade(:)
@@ -99,7 +97,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                     parseArgumentsOpt(c)
                       parseConditionalExpressionRest(a)
@@ -116,7 +113,6 @@
                                         parsePrimary([, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                             parseSend([, expression, ConstantPatternContext.none)
-                                              isNextIdentifier([)
                                               ensureIdentifier([, expression)
                                                 listener: handleIdentifier(b, expression)
                                               listener: handleNoTypeArguments(])
@@ -132,7 +128,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(c, expression)
                                     listener: handleNoTypeArguments(;)
@@ -142,7 +137,7 @@
                         listener: endConditionalExpression(?, :, c)
                   ensureSemicolon(c)
                   listener: handleExpressionStatement(a, ;)
-          notEofOrValue(}, a)
+          notEofOrType(CLOSE_CURLY_BRACKET, a)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -154,7 +149,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(a, expression)
                               listener: handleNoTypeArguments(?)
@@ -173,7 +167,6 @@
                                         parsePrimary([, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                             parseSend([, expression, ConstantPatternContext.none)
-                                              isNextIdentifier([)
                                               ensureIdentifier([, expression)
                                               parseArgumentsOpt(b)
                         parseExpressionWithoutCascade(:)
@@ -182,7 +175,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                     parseArgumentsOpt(c)
                       parseConditionalExpressionRest(a)
@@ -199,7 +191,6 @@
                                         parsePrimary([, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                             parseSend([, expression, ConstantPatternContext.none)
-                                              isNextIdentifier([)
                                               ensureIdentifier([, expression)
                                                 listener: handleIdentifier(b, expression)
                                               listener: handleNoTypeArguments(])
@@ -215,7 +206,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(c, expression)
                                     listener: handleNoTypeArguments(;)
@@ -225,7 +215,7 @@
                         listener: endConditionalExpression(?, :, c)
                   ensureSemicolon(c)
                   listener: handleExpressionStatement(a, ;)
-          notEofOrValue(}, a)
+          notEofOrType(CLOSE_CURLY_BRACKET, a)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -237,7 +227,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(a, expression)
                               listener: handleNoTypeArguments(?)
@@ -256,13 +245,11 @@
                                         parsePrimary([, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                             parseSend([, expression, ConstantPatternContext.none)
-                                              isNextIdentifier([)
                                               ensureIdentifier([, expression)
                                               parseArgumentsOpt(b)
                             parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                 parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                  isNextIdentifier(.)
                                   ensureIdentifier(., expressionContinuation)
                                   parseArgumentsOpt(toString)
                                     parseArguments(toString)
@@ -273,7 +260,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                     parseArgumentsOpt(c)
                       parseConditionalExpressionRest(a)
@@ -290,7 +276,6 @@
                                         parsePrimary([, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                             parseSend([, expression, ConstantPatternContext.none)
-                                              isNextIdentifier([)
                                               ensureIdentifier([, expression)
                                                 listener: handleIdentifier(b, expression)
                                               listener: handleNoTypeArguments(])
@@ -301,7 +286,6 @@
                             parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                 parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                  isNextIdentifier(.)
                                   ensureIdentifier(., expressionContinuation)
                                     listener: handleIdentifier(toString, expressionContinuation)
                                   listener: handleNoTypeArguments(()
@@ -320,7 +304,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(c, expression)
                                     listener: handleNoTypeArguments(;)
@@ -330,7 +313,7 @@
                         listener: endConditionalExpression(?, :, c)
                   ensureSemicolon(c)
                   listener: handleExpressionStatement(a, ;)
-          notEofOrValue(}, a)
+          notEofOrType(CLOSE_CURLY_BRACKET, a)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -342,7 +325,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(a, expression)
                               listener: handleNoTypeArguments(?)
@@ -361,13 +343,11 @@
                                         parsePrimary([, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                             parseSend([, expression, ConstantPatternContext.none)
-                                              isNextIdentifier([)
                                               ensureIdentifier([, expression)
                                               parseArgumentsOpt(b)
                             parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                 parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                  isNextIdentifier(.)
                                   ensureIdentifier(., expressionContinuation)
                                   parseArgumentsOpt(toString)
                                     parseArguments(toString)
@@ -378,7 +358,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                     parseArgumentsOpt(c)
                       parseConditionalExpressionRest(a)
@@ -395,7 +374,6 @@
                                         parsePrimary([, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                             parseSend([, expression, ConstantPatternContext.none)
-                                              isNextIdentifier([)
                                               ensureIdentifier([, expression)
                                                 listener: handleIdentifier(b, expression)
                                               listener: handleNoTypeArguments(])
@@ -406,7 +384,6 @@
                             parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                 parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                  isNextIdentifier(.)
                                   ensureIdentifier(., expressionContinuation)
                                     listener: handleIdentifier(toString, expressionContinuation)
                                   listener: handleNoTypeArguments(()
@@ -425,7 +402,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(c, expression)
                                     listener: handleNoTypeArguments(;)
@@ -435,7 +411,7 @@
                         listener: endConditionalExpression(?, :, c)
                   ensureSemicolon(c)
                   listener: handleExpressionStatement(a, ;)
-          notEofOrValue(}, a)
+          notEofOrType(CLOSE_CURLY_BRACKET, a)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -447,7 +423,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(a, expression)
                               listener: handleNoTypeArguments(?)
@@ -473,7 +448,6 @@
                                           parsePrimary([, expression, ConstantPatternContext.none)
                                             parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                               parseSend([, expression, ConstantPatternContext.none)
-                                                isNextIdentifier([)
                                                 ensureIdentifier([, expression)
                                                   listener: handleIdentifier(b, expression)
                                                 listener: handleNoTypeArguments(])
@@ -500,7 +474,6 @@
                                           parsePrimary([, expression, ConstantPatternContext.none)
                                             parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                               parseSend([, expression, ConstantPatternContext.none)
-                                                isNextIdentifier([)
                                                 ensureIdentifier([, expression)
                                                   listener: handleIdentifier(c, expression)
                                                 listener: handleNoTypeArguments(])
@@ -511,7 +484,7 @@
                         listener: endConditionalExpression(?, :, ])
                   ensureSemicolon(])
                   listener: handleExpressionStatement(a, ;)
-          notEofOrValue(}, a)
+          notEofOrType(CLOSE_CURLY_BRACKET, a)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -523,7 +496,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(a, expression)
                               listener: handleNoTypeArguments(?)
@@ -551,7 +523,6 @@
                                                     parsePrimary([, expression, ConstantPatternContext.none)
                                                       parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                                         parseSend([, expression, ConstantPatternContext.none)
-                                                          isNextIdentifier([)
                                                           ensureIdentifier([, expression)
                                                             listener: handleIdentifier(b, expression)
                                                           listener: handleNoTypeArguments(])
@@ -582,7 +553,6 @@
                                                     parsePrimary([, expression, ConstantPatternContext.none)
                                                       parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                                         parseSend([, expression, ConstantPatternContext.none)
-                                                          isNextIdentifier([)
                                                           ensureIdentifier([, expression)
                                                             listener: handleIdentifier(c, expression)
                                                           listener: handleNoTypeArguments(])
@@ -595,7 +565,7 @@
                         listener: endConditionalExpression(?, :, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(a, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(7, {, })
         listener: endTopLevelMethod(f, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/also-nnbd/issue_40267_conditional_2.dart.intertwined.expect b/pkg/front_end/parser_testcases/also-nnbd/issue_40267_conditional_2.dart.intertwined.expect
index 137857a..7c9c5ba 100644
--- a/pkg/front_end/parser_testcases/also-nnbd/issue_40267_conditional_2.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/also-nnbd/issue_40267_conditional_2.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
@@ -52,7 +52,7 @@
                     listener: endInitializedIdentifier(b)
                   ensureSemicolon(b)
                   listener: endVariablesDeclaration(2, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -63,7 +63,6 @@
                       parsePrimary(return, expression, ConstantPatternContext.none)
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               listener: handleIdentifier(a, expression)
                             listener: handleNoTypeArguments(?)
@@ -83,7 +82,6 @@
                                         parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                           looksLikeFunctionBody(])
                                           parseSend([, expression, ConstantPatternContext.none)
-                                            isNextIdentifier([)
                                             ensureIdentifier([, expression)
                                             parseArgumentsOpt(b)
                                               parseArguments(b)
@@ -116,7 +114,6 @@
                                         parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                           looksLikeFunctionBody(])
                                           parseSend([, expression, ConstantPatternContext.none)
-                                            isNextIdentifier([)
                                             ensureIdentifier([, expression)
                                               listener: handleIdentifier(b, expression)
                                             listener: handleNoTypeArguments(()
@@ -149,7 +146,7 @@
                 ensureSemicolon(null)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(f, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/also-nnbd/issue_40267_conditional_3.dart.intertwined.expect b/pkg/front_end/parser_testcases/also-nnbd/issue_40267_conditional_3.dart.intertwined.expect
index ee34835..2469021 100644
--- a/pkg/front_end/parser_testcases/also-nnbd/issue_40267_conditional_3.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/also-nnbd/issue_40267_conditional_3.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
@@ -45,7 +45,7 @@
                     listener: endInitializedIdentifier(a)
                   ensureSemicolon(a)
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -56,7 +56,6 @@
                       parsePrimary(return, expression, ConstantPatternContext.none)
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               listener: handleIdentifier(a, expression)
                             listener: handleNoTypeArguments(!=)
@@ -81,7 +80,6 @@
                                         parsePrimary([, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                             parseSend([, expression, ConstantPatternContext.none)
-                                              isNextIdentifier([)
                                               ensureIdentifier([, expression)
                                               parseArgumentsOpt(a)
                         parseExpressionWithoutCascade(:)
@@ -106,7 +104,6 @@
                                       parsePrimary([, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                           parseSend([, expression, ConstantPatternContext.none)
-                                            isNextIdentifier([)
                                             ensureIdentifier([, expression)
                                             parseArgumentsOpt(a)
                       parseExpressionWithoutCascade(:)
@@ -132,7 +129,6 @@
                                       parsePrimary([, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                           parseSend([, expression, ConstantPatternContext.none)
-                                            isNextIdentifier([)
                                             ensureIdentifier([, expression)
                                               listener: handleIdentifier(a, expression)
                                             listener: handleNoTypeArguments(])
@@ -159,7 +155,7 @@
                 ensureSemicolon(])
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(f, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/also-nnbd/issue_40267_conditional_4.dart.intertwined.expect b/pkg/front_end/parser_testcases/also-nnbd/issue_40267_conditional_4.dart.intertwined.expect
index f7a7f33..6c2816d 100644
--- a/pkg/front_end/parser_testcases/also-nnbd/issue_40267_conditional_4.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/also-nnbd/issue_40267_conditional_4.dart.intertwined.expect
@@ -63,7 +63,6 @@
                   parsePrimary(=>, expression, ConstantPatternContext.none)
                     parseSendOrFunctionLiteral(=>, expression, ConstantPatternContext.none)
                       parseSend(=>, expression, ConstantPatternContext.none)
-                        isNextIdentifier(=>)
                         ensureIdentifier(=>, expression)
                           listener: handleIdentifier(a, expression)
                         listener: handleNoTypeArguments(..)
@@ -73,7 +72,6 @@
                 parseCascadeExpression(a)
                   listener: beginCascade(..)
                   parseSend(.., expressionContinuation, ConstantPatternContext.none)
-                    isNextIdentifier(..)
                     ensureIdentifier(.., expressionContinuation)
                       listener: handleIdentifier(addAll, expressionContinuation)
                     listener: handleNoTypeArguments(()
@@ -89,7 +87,6 @@
                                     parsePrimary(!, expression, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral(!, expression, ConstantPatternContext.none)
                                         parseSend(!, expression, ConstantPatternContext.none)
-                                          isNextIdentifier(!)
                                           ensureIdentifier(!, expression)
                                             listener: handleIdentifier(b, expression)
                                           listener: handleNoTypeArguments(&&)
@@ -103,7 +100,6 @@
                                   parsePrimary(&&, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(&&, expression, ConstantPatternContext.none)
                                       parseSend(&&, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(&&)
                                         ensureIdentifier(&&, expression)
                                           listener: handleIdentifier(c, expression)
                                         listener: handleNoTypeArguments([)
@@ -117,7 +113,6 @@
                                         parsePrimary([, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                             parseSend([, expression, ConstantPatternContext.none)
-                                              isNextIdentifier([)
                                               ensureIdentifier([, expression)
                                                 listener: handleIdentifier(d, expression)
                                               listener: handleNoTypeArguments(])
@@ -137,7 +132,6 @@
                                                     parsePrimary([, expression, ConstantPatternContext.none)
                                                       parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                                         parseSend([, expression, ConstantPatternContext.none)
-                                                          isNextIdentifier([)
                                                           ensureIdentifier([, expression)
                                                           parseArgumentsOpt(a)
                                               parseExpression(,)
@@ -147,7 +141,6 @@
                                                       parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                                         looksLikeFunctionBody(])
                                                         parseSend(,, expression, ConstantPatternContext.none)
-                                                          isNextIdentifier(,)
                                                           ensureIdentifier(,, expression)
                                                           parseArgumentsOpt(e)
                                                             parseArguments(e)
@@ -158,7 +151,6 @@
                                                                       parsePrimary((, expression, ConstantPatternContext.none)
                                                                         parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                                           parseSend((, expression, ConstantPatternContext.none)
-                                                                            isNextIdentifier(()
                                                                             ensureIdentifier((, expression)
                                                                             parseArgumentsOpt(f)
                                     parseExpressionWithoutCascade(:)
@@ -172,7 +164,6 @@
                                                     parsePrimary([, expression, ConstantPatternContext.none)
                                                       parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                                         parseSend([, expression, ConstantPatternContext.none)
-                                                          isNextIdentifier([)
                                                           ensureIdentifier([, expression)
                                                           parseArgumentsOpt(a)
                                 canParseAsConditional(?)
@@ -187,7 +178,6 @@
                                                   parsePrimary([, expression, ConstantPatternContext.none)
                                                     parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                                       parseSend([, expression, ConstantPatternContext.none)
-                                                        isNextIdentifier([)
                                                         ensureIdentifier([, expression)
                                                         parseArgumentsOpt(a)
                                             parseExpression(,)
@@ -197,7 +187,6 @@
                                                     parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                                       looksLikeFunctionBody(])
                                                       parseSend(,, expression, ConstantPatternContext.none)
-                                                        isNextIdentifier(,)
                                                         ensureIdentifier(,, expression)
                                                         parseArgumentsOpt(e)
                                                           parseArguments(e)
@@ -208,7 +197,6 @@
                                                                     parsePrimary((, expression, ConstantPatternContext.none)
                                                                       parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                                         parseSend((, expression, ConstantPatternContext.none)
-                                                                          isNextIdentifier(()
                                                                           ensureIdentifier((, expression)
                                                                           parseArgumentsOpt(f)
                                   parseExpressionWithoutCascade(:)
@@ -222,7 +210,6 @@
                                                   parsePrimary([, expression, ConstantPatternContext.none)
                                                     parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                                       parseSend([, expression, ConstantPatternContext.none)
-                                                        isNextIdentifier([)
                                                         ensureIdentifier([, expression)
                                                         parseArgumentsOpt(a)
                               listener: endBinaryExpression(&&, ])
@@ -238,7 +225,6 @@
                                                 parsePrimary([, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                                     parseSend([, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier([)
                                                       ensureIdentifier([, expression)
                                                       parseArgumentsOpt(a)
                                           parseExpression(,)
@@ -248,7 +234,6 @@
                                                   parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                                     looksLikeFunctionBody(])
                                                     parseSend(,, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(,)
                                                       ensureIdentifier(,, expression)
                                                       parseArgumentsOpt(e)
                                                         parseArguments(e)
@@ -259,7 +244,6 @@
                                                                   parsePrimary((, expression, ConstantPatternContext.none)
                                                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                                       parseSend((, expression, ConstantPatternContext.none)
-                                                                        isNextIdentifier(()
                                                                         ensureIdentifier((, expression)
                                                                         parseArgumentsOpt(f)
                                 parseExpressionWithoutCascade(:)
@@ -273,7 +257,6 @@
                                                 parsePrimary([, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                                     parseSend([, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier([)
                                                       ensureIdentifier([, expression)
                                                       parseArgumentsOpt(a)
                               parseConditionalExpressionRest(])
@@ -290,7 +273,6 @@
                                                 parsePrimary([, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                                     parseSend([, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier([)
                                                       ensureIdentifier([, expression)
                                                         listener: handleIdentifier(a, expression)
                                                       listener: handleNoTypeArguments(,)
@@ -304,7 +286,6 @@
                                                   parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                                     looksLikeFunctionBody(])
                                                     parseSend(,, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(,)
                                                       ensureIdentifier(,, expression)
                                                         listener: handleIdentifier(e, expression)
                                                       listener: handleNoTypeArguments(()
@@ -318,7 +299,6 @@
                                                                   parsePrimary((, expression, ConstantPatternContext.none)
                                                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                                       parseSend((, expression, ConstantPatternContext.none)
-                                                                        isNextIdentifier(()
                                                                         ensureIdentifier((, expression)
                                                                           listener: handleIdentifier(f, expression)
                                                                         listener: handleNoTypeArguments())
@@ -342,7 +322,6 @@
                                                 parsePrimary([, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                                     parseSend([, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier([)
                                                       ensureIdentifier([, expression)
                                                         listener: handleIdentifier(a, expression)
                                                       listener: handleNoTypeArguments(])
diff --git a/pkg/front_end/parser_testcases/also-nnbd/issue_40288.dart.intertwined.expect b/pkg/front_end/parser_testcases/also-nnbd/issue_40288.dart.intertwined.expect
index 448eb52..5e1a1ad 100644
--- a/pkg/front_end/parser_testcases/also-nnbd/issue_40288.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/also-nnbd/issue_40288.dart.intertwined.expect
@@ -27,7 +27,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(late, DeclarationKind.Class, late)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, late)
               parseMetadataStar({)
                 listener: beginMetadataStar(int)
@@ -64,7 +64,7 @@
                     inGenerator()
                 listener: endClassMethod(get, int, =>, null, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -93,7 +93,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(required, DeclarationKind.Class, required)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, required)
               parseMetadataStar({)
                 listener: beginMetadataStar(int)
@@ -130,7 +130,7 @@
                     inGenerator()
                 listener: endClassMethod(get, int, =>, null, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -157,7 +157,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(C, DeclarationKind.Class, C)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, late)
+            notEofOrType(CLOSE_CURLY_BRACKET, late)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, C)
               parseMetadataStar({)
                 listener: beginMetadataStar(late)
@@ -181,7 +181,6 @@
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               ensureIdentifier(=, expression)
                                 inPlainSync()
                                 listener: handleIdentifier(late, expression)
@@ -195,7 +194,7 @@
                   listener: endFieldInitializer(=, ))
                 listener: endClassFields(null, null, null, null, null, late, null, 1, late, ;)
               listener: endMember()
-            notEofOrValue(}, required)
+            notEofOrType(CLOSE_CURLY_BRACKET, required)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, C)
               parseMetadataStar(;)
                 listener: beginMetadataStar(required)
@@ -221,7 +220,6 @@
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               ensureIdentifier(=, expression)
                                 inPlainSync()
                                 listener: handleIdentifier(required, expression)
@@ -235,7 +233,7 @@
                   listener: endFieldInitializer(=, ))
                 listener: endClassFields(null, null, null, null, null, null, null, 1, required, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 2, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/also-nnbd/issue_40288_prime.dart.intertwined.expect b/pkg/front_end/parser_testcases/also-nnbd/issue_40288_prime.dart.intertwined.expect
index 21fa447..748a355 100644
--- a/pkg/front_end/parser_testcases/also-nnbd/issue_40288_prime.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/also-nnbd/issue_40288_prime.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Xlate, DeclarationKind.Class, Xlate)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Xlate)
               parseMetadataStar({)
                 listener: beginMetadataStar(int)
@@ -62,7 +62,7 @@
                     inGenerator()
                 listener: endClassMethod(get, int, =>, null, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -89,7 +89,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Xrequired, DeclarationKind.Class, Xrequired)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Xrequired)
               parseMetadataStar({)
                 listener: beginMetadataStar(int)
@@ -126,7 +126,7 @@
                     inGenerator()
                 listener: endClassMethod(get, int, =>, null, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -153,7 +153,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(C, DeclarationKind.Class, C)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, Xlate)
+            notEofOrType(CLOSE_CURLY_BRACKET, Xlate)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, C)
               parseMetadataStar({)
                 listener: beginMetadataStar(Xlate)
@@ -175,7 +175,6 @@
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               ensureIdentifier(=, expression)
                                 listener: handleIdentifier(Xlate, expression)
                               listener: handleNoTypeArguments(()
@@ -188,7 +187,7 @@
                   listener: endFieldInitializer(=, ))
                 listener: endClassFields(null, null, null, null, null, null, null, 1, Xlate, ;)
               listener: endMember()
-            notEofOrValue(}, Xrequired)
+            notEofOrType(CLOSE_CURLY_BRACKET, Xrequired)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, C)
               parseMetadataStar(;)
                 listener: beginMetadataStar(Xrequired)
@@ -210,7 +209,6 @@
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               ensureIdentifier(=, expression)
                                 listener: handleIdentifier(Xrequired, expression)
                               listener: handleNoTypeArguments(()
@@ -223,7 +221,7 @@
                   listener: endFieldInitializer(=, ))
                 listener: endClassFields(null, null, null, null, null, null, null, 1, Xrequired, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 2, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/also-nnbd/nullable_type_argument.dart.intertwined.expect b/pkg/front_end/parser_testcases/also-nnbd/nullable_type_argument.dart.intertwined.expect
index f38d3db..0dc5ed1 100644
--- a/pkg/front_end/parser_testcases/also-nnbd/nullable_type_argument.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/also-nnbd/nullable_type_argument.dart.intertwined.expect
@@ -33,7 +33,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(>, DeclarationKind.Class, A)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -68,7 +68,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(>, DeclarationKind.Class, B)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/also-nnbd/use_late_in_non_nnbd.dart.intertwined.expect b/pkg/front_end/parser_testcases/also-nnbd/use_late_in_non_nnbd.dart.intertwined.expect
index 836bda4..d832cc2 100644
--- a/pkg/front_end/parser_testcases/also-nnbd/use_late_in_non_nnbd.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/also-nnbd/use_late_in_non_nnbd.dart.intertwined.expect
@@ -172,7 +172,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, int)
+          notEofOrType(CLOSE_CURLY_BRACKET, int)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -193,7 +193,7 @@
                     listener: endInitializedIdentifier(y1)
                   ensureSemicolon(y1)
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, late)
+          notEofOrType(CLOSE_CURLY_BRACKET, late)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -215,7 +215,7 @@
                       listener: endInitializedIdentifier(y2)
                     ensureSemicolon(y2)
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, late)
+          notEofOrType(CLOSE_CURLY_BRACKET, late)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -241,7 +241,7 @@
                       listener: endInitializedIdentifier(y3)
                     ensureSemicolon(y3)
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, late)
+          notEofOrType(CLOSE_CURLY_BRACKET, late)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -263,7 +263,7 @@
                       listener: endInitializedIdentifier(y4)
                     ensureSemicolon(y4)
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, late)
+          notEofOrType(CLOSE_CURLY_BRACKET, late)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -285,12 +285,12 @@
                       listener: endInitializedIdentifier(y5)
                     ensureSemicolon(y5)
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, ;)
+          notEofOrType(CLOSE_CURLY_BRACKET, ;)
           parseStatement(;)
             parseStatementX(;)
               parseEmptyStatement(;)
                 listener: handleEmptyStatement(;)
-          notEofOrValue(}, late)
+          notEofOrType(CLOSE_CURLY_BRACKET, late)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -304,7 +304,6 @@
                             inPlainSync()
                             parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                               parseSend(;, expression, ConstantPatternContext.none)
-                                isNextIdentifier(;)
                                 ensureIdentifier(;, expression)
                                   inPlainSync()
                                   listener: handleIdentifier(late, expression)
@@ -314,12 +313,12 @@
                                 listener: handleSend(late, late)
                     ensureSemicolon(late)
                     listener: handleExpressionStatement(late, ;)
-          notEofOrValue(}, ;)
+          notEofOrType(CLOSE_CURLY_BRACKET, ;)
           parseStatement(;)
             parseStatementX(;)
               parseEmptyStatement(;)
                 listener: handleEmptyStatement(;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(8, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
@@ -346,7 +345,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Foo, DeclarationKind.Class, Foo)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Foo)
               parseMetadataStar({)
                 listener: beginMetadataStar(int)
@@ -363,7 +362,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, late)
+            notEofOrType(CLOSE_CURLY_BRACKET, late)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(late)
@@ -380,7 +379,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, null, null, late, null, 1, late, ;)
               listener: endMember()
-            notEofOrValue(}, late)
+            notEofOrType(CLOSE_CURLY_BRACKET, late)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(late)
@@ -401,7 +400,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, null, null, late, null, 1, late, ;)
               listener: endMember()
-            notEofOrValue(}, late)
+            notEofOrType(CLOSE_CURLY_BRACKET, late)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(late)
@@ -420,7 +419,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, null, null, late, final, 1, late, ;)
               listener: endMember()
-            notEofOrValue(}, late)
+            notEofOrType(CLOSE_CURLY_BRACKET, late)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(late)
@@ -438,7 +437,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, null, null, late, null, 1, late, ;)
               listener: endMember()
-            notEofOrValue(}, ;)
+            notEofOrType(CLOSE_CURLY_BRACKET, ;)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(;)
@@ -449,7 +448,7 @@
                   listener: handleRecoverableError(Message[ExpectedClassMember, Expected a class member, but got ';'., null, {lexeme: ;}], ;, ;)
                 listener: handleInvalidMember(;)
                 listener: endMember()
-            notEofOrValue(}, late)
+            notEofOrType(CLOSE_CURLY_BRACKET, late)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(late)
@@ -466,7 +465,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, late, ;)
               listener: endMember()
-            notEofOrValue(}, ;)
+            notEofOrType(CLOSE_CURLY_BRACKET, ;)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(;)
@@ -477,7 +476,7 @@
                   listener: handleRecoverableError(Message[ExpectedClassMember, Expected a class member, but got ';'., null, {lexeme: ;}], ;, ;)
                 listener: handleInvalidMember(;)
                 listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 8, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/also-nnbd/use_required_in_non_nnbd.dart.intertwined.expect b/pkg/front_end/parser_testcases/also-nnbd/use_required_in_non_nnbd.dart.intertwined.expect
index a2cc0d9..7e25814 100644
--- a/pkg/front_end/parser_testcases/also-nnbd/use_required_in_non_nnbd.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/also-nnbd/use_required_in_non_nnbd.dart.intertwined.expect
@@ -41,7 +41,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, print)
+          notEofOrType(CLOSE_CURLY_BRACKET, print)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -54,7 +54,6 @@
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(print, expression)
                               listener: handleNoTypeArguments(()
@@ -68,7 +67,6 @@
                                           parsePrimary((, expression, ConstantPatternContext.none)
                                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                               parseSend((, expression, ConstantPatternContext.none)
-                                                isNextIdentifier(()
                                                 ensureIdentifier((, expression)
                                                   listener: handleIdentifier(x, expression)
                                                 listener: handleNoTypeArguments())
@@ -79,7 +77,7 @@
                               listener: handleSend(print, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(print, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -120,7 +118,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, print)
+          notEofOrType(CLOSE_CURLY_BRACKET, print)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -133,7 +131,6 @@
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(print, expression)
                               listener: handleNoTypeArguments(()
@@ -147,7 +144,6 @@
                                           parsePrimary((, expression, ConstantPatternContext.none)
                                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                               parseSend((, expression, ConstantPatternContext.none)
-                                                isNextIdentifier(()
                                                 ensureIdentifier((, expression)
                                                   listener: handleIdentifier(x, expression)
                                                 listener: handleNoTypeArguments())
@@ -158,7 +154,7 @@
                               listener: handleSend(print, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(print, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -203,7 +199,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, print)
+          notEofOrType(CLOSE_CURLY_BRACKET, print)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -216,7 +212,6 @@
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(print, expression)
                               listener: handleNoTypeArguments(()
@@ -230,7 +225,6 @@
                                           parsePrimary((, expression, ConstantPatternContext.none)
                                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                               parseSend((, expression, ConstantPatternContext.none)
-                                                isNextIdentifier(()
                                                 ensureIdentifier((, expression)
                                                   listener: handleIdentifier(x, expression)
                                                 listener: handleNoTypeArguments())
@@ -241,7 +235,7 @@
                               listener: handleSend(print, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(print, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -268,7 +262,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Foo, DeclarationKind.Class, Foo)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Foo)
               parseMetadataStar({)
                 listener: beginMetadataStar(void)
@@ -311,7 +305,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, print)
+                  notEofOrType(CLOSE_CURLY_BRACKET, print)
                   parseStatement({)
                     parseStatementX({)
                       parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -324,7 +318,6 @@
                                   parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                                     looksLikeFunctionBody(;)
                                     parseSend({, expression, ConstantPatternContext.none)
-                                      isNextIdentifier({)
                                       ensureIdentifier({, expression)
                                         listener: handleIdentifier(print, expression)
                                       listener: handleNoTypeArguments(()
@@ -338,7 +331,6 @@
                                                   parsePrimary((, expression, ConstantPatternContext.none)
                                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                       parseSend((, expression, ConstantPatternContext.none)
-                                                        isNextIdentifier(()
                                                         ensureIdentifier((, expression)
                                                           listener: handleIdentifier(x, expression)
                                                         listener: handleNoTypeArguments())
@@ -349,11 +341,11 @@
                                       listener: handleSend(print, ))
                           ensureSemicolon())
                           listener: handleExpressionStatement(print, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(null, void, (, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/augmentation/augment_super.dart.intertwined.expect b/pkg/front_end/parser_testcases/augmentation/augment_super.dart.intertwined.expect
index 726d45c..0397b96 100644
--- a/pkg/front_end/parser_testcases/augmentation/augment_super.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/augmentation/augment_super.dart.intertwined.expect
@@ -25,7 +25,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, augment)
+          notEofOrType(CLOSE_CURLY_BRACKET, augment)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -44,7 +44,7 @@
                             listener: handleSend(augment, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(augment, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(augment, null, })
   listener: endTopLevelDeclaration(})
@@ -71,7 +71,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, augment)
+          notEofOrType(CLOSE_CURLY_BRACKET, augment)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -95,7 +95,7 @@
                       listener: endInitializedIdentifier(local)
                     ensureSemicolon(local)
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, augment)
+          notEofOrType(CLOSE_CURLY_BRACKET, augment)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -109,7 +109,6 @@
                             inPlainSync()
                             parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                               parseSend(;, expression, ConstantPatternContext.none)
-                                isNextIdentifier(;)
                                 ensureIdentifier(;, expression)
                                   inPlainSync()
                                   listener: handleIdentifier(augment, expression)
@@ -119,7 +118,7 @@
                                 listener: handleSend(augment, augment)
                     ensureSemicolon(augment)
                     listener: handleExpressionStatement(augment, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(augment, null, })
   listener: endTopLevelDeclaration(})
@@ -149,7 +148,7 @@
         inPlainSync()
         parseFunctionBody(topLevelProperty, false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement({)
             parseStatementX({)
               parseReturnStatement({)
@@ -185,7 +184,7 @@
                 ensureSemicolon(])
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(augment, get, })
   listener: endTopLevelDeclaration(})
@@ -228,7 +227,7 @@
         inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, augment)
+          notEofOrType(CLOSE_CURLY_BRACKET, augment)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -252,7 +251,6 @@
                           parsePrimary(=, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                               parseSend(=, expression, ConstantPatternContext.none)
-                                isNextIdentifier(=)
                                 ensureIdentifier(=, expression)
                                   listener: handleIdentifier(value, expression)
                                 listener: handleNoTypeArguments([)
@@ -270,7 +268,7 @@
                       listener: handleAssignmentExpression(=, ])
                   ensureSemicolon(])
                   listener: handleExpressionStatement(augment, ;)
-          notEofOrValue(}, augment)
+          notEofOrType(CLOSE_CURLY_BRACKET, augment)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -286,7 +284,6 @@
                           parsePrimary(=, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                               parseSend(=, expression, ConstantPatternContext.none)
-                                isNextIdentifier(=)
                                 ensureIdentifier(=, expression)
                                   listener: handleIdentifier(value, expression)
                                 listener: handleNoTypeArguments(;)
@@ -296,7 +293,7 @@
                       listener: handleAssignmentExpression(=, value)
                   ensureSemicolon(value)
                   listener: handleExpressionStatement(augment, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(augment, set, })
   listener: endTopLevelDeclaration(})
@@ -323,7 +320,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, augment)
+          notEofOrType(CLOSE_CURLY_BRACKET, augment)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -342,7 +339,7 @@
                             listener: handleSend(augment, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(augment, ;)
-          notEofOrValue(}, augment)
+          notEofOrType(CLOSE_CURLY_BRACKET, augment)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -355,7 +352,7 @@
                             listener: handleAugmentSuperExpression(augment, super, expression)
                   ensureSemicolon(super)
                   listener: handleExpressionStatement(augment, ;)
-          notEofOrValue(}, augment)
+          notEofOrType(CLOSE_CURLY_BRACKET, augment)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -379,7 +376,7 @@
                       listener: endInitializedIdentifier(local)
                     ensureSemicolon(local)
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, augment)
+          notEofOrType(CLOSE_CURLY_BRACKET, augment)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -393,7 +390,6 @@
                             inPlainSync()
                             parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                               parseSend(;, expression, ConstantPatternContext.none)
-                                isNextIdentifier(;)
                                 ensureIdentifier(;, expression)
                                   inPlainSync()
                                   listener: handleIdentifier(augment, expression)
@@ -403,7 +399,7 @@
                                 listener: handleSend(augment, augment)
                     ensureSemicolon(augment)
                     listener: handleExpressionStatement(augment, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(4, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -430,7 +426,7 @@
             listener: handleClassHeader(augment, class, null)
           parseClassOrMixinOrExtensionBody(Class, DeclarationKind.Class, Class)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Class)
               parseMetadataStar({)
                 listener: beginMetadataStar(augment)
@@ -457,7 +453,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, augment)
+                  notEofOrType(CLOSE_CURLY_BRACKET, augment)
                   parseStatement({)
                     parseStatementX({)
                       parseExpressionStatementOrDeclaration({, null)
@@ -476,11 +472,11 @@
                                     listener: handleSend(augment, ))
                           ensureSemicolon())
                           listener: handleExpressionStatement(augment, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(null, augment, (, null, })
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Class)
               parseMetadataStar(})
                 listener: beginMetadataStar(augment)
@@ -507,7 +503,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, augment)
+                  notEofOrType(CLOSE_CURLY_BRACKET, augment)
                   parseStatement({)
                     parseStatementX({)
                       parseExpressionStatementOrDeclaration({, null)
@@ -531,7 +527,7 @@
                               listener: endInitializedIdentifier(local)
                             ensureSemicolon(local)
                             listener: endVariablesDeclaration(1, ;)
-                  notEofOrValue(}, augment)
+                  notEofOrType(CLOSE_CURLY_BRACKET, augment)
                   parseStatement(;)
                     parseStatementX(;)
                       parseExpressionStatementOrDeclaration(;, null)
@@ -545,7 +541,6 @@
                                     inPlainSync()
                                     parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                                       parseSend(;, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(;)
                                         ensureIdentifier(;, expression)
                                           inPlainSync()
                                           listener: handleIdentifier(augment, expression)
@@ -555,11 +550,11 @@
                                         listener: handleSend(augment, augment)
                             ensureSemicolon(augment)
                             listener: handleExpressionStatement(augment, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, augment, (, null, })
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Class)
               parseMetadataStar(})
                 listener: beginMetadataStar(augment)
@@ -585,7 +580,7 @@
                 inPlainSync()
                 parseFunctionBody(instanceProperty, false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, augment)
+                  notEofOrType(CLOSE_CURLY_BRACKET, augment)
                   parseStatement({)
                     parseStatementX({)
                       parseExpressionStatementOrDeclaration({, null)
@@ -599,7 +594,7 @@
                               listener: handleUnaryPostfixAssignmentExpression(++)
                           ensureSemicolon(++)
                           listener: handleExpressionStatement(augment, ;)
-                  notEofOrValue(}, --)
+                  notEofOrType(CLOSE_CURLY_BRACKET, --)
                   parseStatement(;)
                     parseStatementX(;)
                       parseExpressionStatementOrDeclaration(;, null)
@@ -617,7 +612,7 @@
                                   listener: handleUnaryPrefixAssignmentExpression(--)
                             ensureSemicolon(super)
                             listener: handleExpressionStatement(--, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -634,11 +629,11 @@
                         ensureSemicolon(super)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(3, {, })
                 listener: endClassMethod(get, augment, {, null, })
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Class)
               parseMetadataStar(})
                 listener: beginMetadataStar(augment)
@@ -677,7 +672,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, augment)
+                  notEofOrType(CLOSE_CURLY_BRACKET, augment)
                   parseStatement({)
                     parseStatementX({)
                       parseExpressionStatementOrDeclaration({, null)
@@ -693,7 +688,6 @@
                                   parsePrimary(=, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                       parseSend(=, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(=)
                                         ensureIdentifier(=, expression)
                                           listener: handleIdentifier(value, expression)
                                         listener: handleNoTypeArguments(;)
@@ -703,11 +697,11 @@
                               listener: handleAssignmentExpression(=, value)
                           ensureSemicolon(value)
                           listener: handleExpressionStatement(augment, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(set, augment, (, null, })
               listener: endMember()
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Class)
               parseMetadataStar(})
                 listener: beginMetadataStar(void)
@@ -734,7 +728,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, augment)
+                  notEofOrType(CLOSE_CURLY_BRACKET, augment)
                   parseStatement({)
                     parseStatementX({)
                       parseExpressionStatementOrDeclaration({, null)
@@ -753,7 +747,7 @@
                                     listener: handleSend(augment, ))
                           ensureSemicolon())
                           listener: handleExpressionStatement(augment, ;)
-                  notEofOrValue(}, augment)
+                  notEofOrType(CLOSE_CURLY_BRACKET, augment)
                   parseStatement(;)
                     parseStatementX(;)
                       parseExpressionStatementOrDeclaration(;, null)
@@ -766,7 +760,7 @@
                                     listener: handleAugmentSuperExpression(augment, super, expression)
                           ensureSemicolon(super)
                           listener: handleExpressionStatement(augment, ;)
-                  notEofOrValue(}, augment)
+                  notEofOrType(CLOSE_CURLY_BRACKET, augment)
                   parseStatement(;)
                     parseStatementX(;)
                       parseExpressionStatementOrDeclaration(;, null)
@@ -790,7 +784,7 @@
                               listener: endInitializedIdentifier(local)
                             ensureSemicolon(local)
                             listener: endVariablesDeclaration(1, ;)
-                  notEofOrValue(}, augment)
+                  notEofOrType(CLOSE_CURLY_BRACKET, augment)
                   parseStatement(;)
                     parseStatementX(;)
                       parseExpressionStatementOrDeclaration(;, null)
@@ -804,7 +798,6 @@
                                     inPlainSync()
                                     parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                                       parseSend(;, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(;)
                                         ensureIdentifier(;, expression)
                                           inPlainSync()
                                           listener: handleIdentifier(augment, expression)
@@ -814,11 +807,11 @@
                                         listener: handleSend(augment, augment)
                             ensureSemicolon(augment)
                             listener: handleExpressionStatement(augment, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(4, {, })
                 listener: endClassMethod(null, void, (, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 5, {, })
           listener: endClassDeclaration(augment, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/augmentation/member_declarations.dart.intertwined.expect b/pkg/front_end/parser_testcases/augmentation/member_declarations.dart.intertwined.expect
index 06c0148..7e4846f 100644
--- a/pkg/front_end/parser_testcases/augmentation/member_declarations.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/augmentation/member_declarations.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Class, DeclarationKind.Class, Class)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Class)
               parseMetadataStar({)
                 listener: beginMetadataStar(augment)
@@ -53,11 +53,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassMethod(null, augment, (, null, })
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Class)
               parseMetadataStar(})
                 listener: beginMetadataStar(augment)
@@ -84,11 +84,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassMethod(null, augment, (, null, })
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Class)
               parseMetadataStar(})
                 listener: beginMetadataStar(augment)
@@ -123,7 +123,7 @@
                     inGenerator()
                 listener: endClassMethod(get, augment, =>, null, ;)
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(augment)
@@ -160,7 +160,7 @@
                     inGenerator()
                 listener: endClassMethod(get, augment, =>, null, ;)
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(augment)
@@ -197,11 +197,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassMethod(set, augment, (, null, })
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Class)
               parseMetadataStar(})
                 listener: beginMetadataStar(augment)
@@ -238,11 +238,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassMethod(set, augment, (, null, })
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Class)
               parseMetadataStar(})
                 listener: beginMetadataStar(augment)
@@ -259,7 +259,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, augment, null, null, null, null, var, 1, augment, ;)
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(augment)
@@ -283,7 +283,7 @@
                   listener: endFieldInitializer(=, 0)
                 listener: endClassFields(null, augment, null, null, null, null, final, 1, augment, ;)
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(augment)
@@ -307,7 +307,7 @@
                   listener: endFieldInitializer(=, 0)
                 listener: endClassFields(null, augment, null, null, null, null, const, 1, augment, ;)
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(augment)
@@ -324,7 +324,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, augment, null, null, null, null, null, 1, augment, ;)
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(augment)
@@ -341,7 +341,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, augment, null, null, null, late, var, 1, augment, ;)
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(augment)
@@ -358,7 +358,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, augment, null, null, null, late, final, 1, augment, ;)
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(augment)
@@ -375,7 +375,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, augment, null, null, null, late, null, 1, augment, ;)
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(augment)
@@ -402,11 +402,11 @@
                   inPlainSync()
                 parseFunctionBody(), false, false)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassMethod(null, augment, (, null, })
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Class)
               parseMetadataStar(})
                 listener: beginMetadataStar(augment)
@@ -432,11 +432,11 @@
                   inPlainSync()
                 parseFunctionBody(), false, false)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassMethod(null, augment, (, null, })
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Class)
               parseMetadataStar(})
                 listener: beginMetadataStar(augment)
@@ -470,7 +470,7 @@
                     inGenerator()
                 listener: endClassMethod(get, augment, =>, null, ;)
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(augment)
@@ -506,7 +506,7 @@
                     inGenerator()
                 listener: endClassMethod(get, augment, =>, null, ;)
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(augment)
@@ -542,11 +542,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, false)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassMethod(set, augment, (, null, })
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Class)
               parseMetadataStar(})
                 listener: beginMetadataStar(augment)
@@ -582,11 +582,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, false)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassMethod(set, augment, (, null, })
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Class)
               parseMetadataStar(})
                 listener: beginMetadataStar(augment)
@@ -603,7 +603,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, augment, null, static, null, null, var, 1, augment, ;)
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(augment)
@@ -627,7 +627,7 @@
                   listener: endFieldInitializer(=, 0)
                 listener: endClassFields(null, augment, null, static, null, null, final, 1, augment, ;)
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(augment)
@@ -651,7 +651,7 @@
                   listener: endFieldInitializer(=, 0)
                 listener: endClassFields(null, augment, null, static, null, null, const, 1, augment, ;)
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(augment)
@@ -668,7 +668,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, augment, null, static, null, null, null, 1, augment, ;)
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(augment)
@@ -685,7 +685,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, augment, null, static, null, late, var, 1, augment, ;)
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(augment)
@@ -702,7 +702,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, augment, null, static, null, late, final, 1, augment, ;)
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(augment)
@@ -719,7 +719,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, augment, null, static, null, late, null, 1, augment, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 26, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -742,7 +742,7 @@
           listener: handleMixinHeader(mixin)
         parseClassOrMixinOrExtensionBody(Mixin, DeclarationKind.Mixin, Mixin)
           listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Mixin, {)
-          notEofOrValue(}, augment)
+          notEofOrType(CLOSE_CURLY_BRACKET, augment)
           parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Mixin, Mixin)
             parseMetadataStar({)
               listener: beginMetadataStar(augment)
@@ -770,11 +770,11 @@
               inPlainSync()
               parseFunctionBody(), false, true)
                 listener: beginBlockFunctionBody({)
-                notEofOrValue(}, })
+                notEofOrType(CLOSE_CURLY_BRACKET, })
                 listener: endBlockFunctionBody(0, {, })
               listener: endMixinMethod(null, augment, (, null, })
             listener: endMember()
-          notEofOrValue(}, augment)
+          notEofOrType(CLOSE_CURLY_BRACKET, augment)
           parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Mixin, Mixin)
             parseMetadataStar(})
               listener: beginMetadataStar(augment)
@@ -801,11 +801,11 @@
               inPlainSync()
               parseFunctionBody(), false, true)
                 listener: beginBlockFunctionBody({)
-                notEofOrValue(}, })
+                notEofOrType(CLOSE_CURLY_BRACKET, })
                 listener: endBlockFunctionBody(0, {, })
               listener: endMixinMethod(null, augment, (, null, })
             listener: endMember()
-          notEofOrValue(}, augment)
+          notEofOrType(CLOSE_CURLY_BRACKET, augment)
           parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Mixin, Mixin)
             parseMetadataStar(})
               listener: beginMetadataStar(augment)
@@ -840,7 +840,7 @@
                   inGenerator()
               listener: endMixinMethod(get, augment, =>, null, ;)
             listener: endMember()
-          notEofOrValue(}, augment)
+          notEofOrType(CLOSE_CURLY_BRACKET, augment)
           parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Mixin, Mixin)
             parseMetadataStar(;)
               listener: beginMetadataStar(augment)
@@ -877,7 +877,7 @@
                   inGenerator()
               listener: endMixinMethod(get, augment, =>, null, ;)
             listener: endMember()
-          notEofOrValue(}, augment)
+          notEofOrType(CLOSE_CURLY_BRACKET, augment)
           parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Mixin, Mixin)
             parseMetadataStar(;)
               listener: beginMetadataStar(augment)
@@ -914,11 +914,11 @@
               inPlainSync()
               parseFunctionBody(), false, true)
                 listener: beginBlockFunctionBody({)
-                notEofOrValue(}, })
+                notEofOrType(CLOSE_CURLY_BRACKET, })
                 listener: endBlockFunctionBody(0, {, })
               listener: endMixinMethod(set, augment, (, null, })
             listener: endMember()
-          notEofOrValue(}, augment)
+          notEofOrType(CLOSE_CURLY_BRACKET, augment)
           parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Mixin, Mixin)
             parseMetadataStar(})
               listener: beginMetadataStar(augment)
@@ -955,11 +955,11 @@
               inPlainSync()
               parseFunctionBody(), false, true)
                 listener: beginBlockFunctionBody({)
-                notEofOrValue(}, })
+                notEofOrType(CLOSE_CURLY_BRACKET, })
                 listener: endBlockFunctionBody(0, {, })
               listener: endMixinMethod(set, augment, (, null, })
             listener: endMember()
-          notEofOrValue(}, augment)
+          notEofOrType(CLOSE_CURLY_BRACKET, augment)
           parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Mixin, Mixin)
             parseMetadataStar(})
               listener: beginMetadataStar(augment)
@@ -976,7 +976,7 @@
                 listener: handleNoFieldInitializer(;)
               listener: endMixinFields(null, augment, null, null, null, null, var, 1, augment, ;)
             listener: endMember()
-          notEofOrValue(}, augment)
+          notEofOrType(CLOSE_CURLY_BRACKET, augment)
           parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Mixin, Mixin)
             parseMetadataStar(;)
               listener: beginMetadataStar(augment)
@@ -1000,7 +1000,7 @@
                 listener: endFieldInitializer(=, 0)
               listener: endMixinFields(null, augment, null, null, null, null, final, 1, augment, ;)
             listener: endMember()
-          notEofOrValue(}, augment)
+          notEofOrType(CLOSE_CURLY_BRACKET, augment)
           parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Mixin, Mixin)
             parseMetadataStar(;)
               listener: beginMetadataStar(augment)
@@ -1024,7 +1024,7 @@
                 listener: endFieldInitializer(=, 0)
               listener: endMixinFields(null, augment, null, null, null, null, const, 1, augment, ;)
             listener: endMember()
-          notEofOrValue(}, augment)
+          notEofOrType(CLOSE_CURLY_BRACKET, augment)
           parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Mixin, Mixin)
             parseMetadataStar(;)
               listener: beginMetadataStar(augment)
@@ -1041,7 +1041,7 @@
                 listener: handleNoFieldInitializer(;)
               listener: endMixinFields(null, augment, null, null, null, null, null, 1, augment, ;)
             listener: endMember()
-          notEofOrValue(}, augment)
+          notEofOrType(CLOSE_CURLY_BRACKET, augment)
           parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Mixin, Mixin)
             parseMetadataStar(;)
               listener: beginMetadataStar(augment)
@@ -1058,7 +1058,7 @@
                 listener: handleNoFieldInitializer(;)
               listener: endMixinFields(null, augment, null, null, null, late, var, 1, augment, ;)
             listener: endMember()
-          notEofOrValue(}, augment)
+          notEofOrType(CLOSE_CURLY_BRACKET, augment)
           parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Mixin, Mixin)
             parseMetadataStar(;)
               listener: beginMetadataStar(augment)
@@ -1075,7 +1075,7 @@
                 listener: handleNoFieldInitializer(;)
               listener: endMixinFields(null, augment, null, null, null, late, final, 1, augment, ;)
             listener: endMember()
-          notEofOrValue(}, augment)
+          notEofOrType(CLOSE_CURLY_BRACKET, augment)
           parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Mixin, Mixin)
             parseMetadataStar(;)
               listener: beginMetadataStar(augment)
@@ -1092,7 +1092,7 @@
                 listener: handleNoFieldInitializer(;)
               listener: endMixinFields(null, augment, null, null, null, late, null, 1, augment, ;)
             listener: endMember()
-          notEofOrValue(}, augment)
+          notEofOrType(CLOSE_CURLY_BRACKET, augment)
           parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Mixin, Mixin)
             parseMetadataStar(;)
               listener: beginMetadataStar(augment)
@@ -1119,11 +1119,11 @@
                 inPlainSync()
               parseFunctionBody(), false, false)
                 listener: beginBlockFunctionBody({)
-                notEofOrValue(}, })
+                notEofOrType(CLOSE_CURLY_BRACKET, })
                 listener: endBlockFunctionBody(0, {, })
               listener: endMixinMethod(null, augment, (, null, })
             listener: endMember()
-          notEofOrValue(}, augment)
+          notEofOrType(CLOSE_CURLY_BRACKET, augment)
           parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Mixin, Mixin)
             parseMetadataStar(})
               listener: beginMetadataStar(augment)
@@ -1149,11 +1149,11 @@
                 inPlainSync()
               parseFunctionBody(), false, false)
                 listener: beginBlockFunctionBody({)
-                notEofOrValue(}, })
+                notEofOrType(CLOSE_CURLY_BRACKET, })
                 listener: endBlockFunctionBody(0, {, })
               listener: endMixinMethod(null, augment, (, null, })
             listener: endMember()
-          notEofOrValue(}, augment)
+          notEofOrType(CLOSE_CURLY_BRACKET, augment)
           parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Mixin, Mixin)
             parseMetadataStar(})
               listener: beginMetadataStar(augment)
@@ -1187,7 +1187,7 @@
                   inGenerator()
               listener: endMixinMethod(get, augment, =>, null, ;)
             listener: endMember()
-          notEofOrValue(}, augment)
+          notEofOrType(CLOSE_CURLY_BRACKET, augment)
           parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Mixin, Mixin)
             parseMetadataStar(;)
               listener: beginMetadataStar(augment)
@@ -1223,7 +1223,7 @@
                   inGenerator()
               listener: endMixinMethod(get, augment, =>, null, ;)
             listener: endMember()
-          notEofOrValue(}, augment)
+          notEofOrType(CLOSE_CURLY_BRACKET, augment)
           parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Mixin, Mixin)
             parseMetadataStar(;)
               listener: beginMetadataStar(augment)
@@ -1259,11 +1259,11 @@
               inPlainSync()
               parseFunctionBody(), false, false)
                 listener: beginBlockFunctionBody({)
-                notEofOrValue(}, })
+                notEofOrType(CLOSE_CURLY_BRACKET, })
                 listener: endBlockFunctionBody(0, {, })
               listener: endMixinMethod(set, augment, (, null, })
             listener: endMember()
-          notEofOrValue(}, augment)
+          notEofOrType(CLOSE_CURLY_BRACKET, augment)
           parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Mixin, Mixin)
             parseMetadataStar(})
               listener: beginMetadataStar(augment)
@@ -1299,11 +1299,11 @@
               inPlainSync()
               parseFunctionBody(), false, false)
                 listener: beginBlockFunctionBody({)
-                notEofOrValue(}, })
+                notEofOrType(CLOSE_CURLY_BRACKET, })
                 listener: endBlockFunctionBody(0, {, })
               listener: endMixinMethod(set, augment, (, null, })
             listener: endMember()
-          notEofOrValue(}, augment)
+          notEofOrType(CLOSE_CURLY_BRACKET, augment)
           parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Mixin, Mixin)
             parseMetadataStar(})
               listener: beginMetadataStar(augment)
@@ -1320,7 +1320,7 @@
                 listener: handleNoFieldInitializer(;)
               listener: endMixinFields(null, augment, null, static, null, null, var, 1, augment, ;)
             listener: endMember()
-          notEofOrValue(}, augment)
+          notEofOrType(CLOSE_CURLY_BRACKET, augment)
           parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Mixin, Mixin)
             parseMetadataStar(;)
               listener: beginMetadataStar(augment)
@@ -1344,7 +1344,7 @@
                 listener: endFieldInitializer(=, 0)
               listener: endMixinFields(null, augment, null, static, null, null, final, 1, augment, ;)
             listener: endMember()
-          notEofOrValue(}, augment)
+          notEofOrType(CLOSE_CURLY_BRACKET, augment)
           parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Mixin, Mixin)
             parseMetadataStar(;)
               listener: beginMetadataStar(augment)
@@ -1368,7 +1368,7 @@
                 listener: endFieldInitializer(=, 0)
               listener: endMixinFields(null, augment, null, static, null, null, const, 1, augment, ;)
             listener: endMember()
-          notEofOrValue(}, augment)
+          notEofOrType(CLOSE_CURLY_BRACKET, augment)
           parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Mixin, Mixin)
             parseMetadataStar(;)
               listener: beginMetadataStar(augment)
@@ -1385,7 +1385,7 @@
                 listener: handleNoFieldInitializer(;)
               listener: endMixinFields(null, augment, null, static, null, null, null, 1, augment, ;)
             listener: endMember()
-          notEofOrValue(}, augment)
+          notEofOrType(CLOSE_CURLY_BRACKET, augment)
           parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Mixin, Mixin)
             parseMetadataStar(;)
               listener: beginMetadataStar(augment)
@@ -1402,7 +1402,7 @@
                 listener: handleNoFieldInitializer(;)
               listener: endMixinFields(null, augment, null, static, null, late, var, 1, augment, ;)
             listener: endMember()
-          notEofOrValue(}, augment)
+          notEofOrType(CLOSE_CURLY_BRACKET, augment)
           parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Mixin, Mixin)
             parseMetadataStar(;)
               listener: beginMetadataStar(augment)
@@ -1419,7 +1419,7 @@
                 listener: handleNoFieldInitializer(;)
               listener: endMixinFields(null, augment, null, static, null, late, final, 1, augment, ;)
             listener: endMember()
-          notEofOrValue(}, augment)
+          notEofOrType(CLOSE_CURLY_BRACKET, augment)
           parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Mixin, Mixin)
             parseMetadataStar(;)
               listener: beginMetadataStar(augment)
@@ -1436,7 +1436,7 @@
                 listener: handleNoFieldInitializer(;)
               listener: endMixinFields(null, augment, null, static, null, late, null, 1, augment, ;)
             listener: endMember()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endClassOrMixinOrExtensionBody(DeclarationKind.Mixin, 26, {, })
         listener: endMixinDeclaration(mixin, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/augmentation/member_errors.dart.intertwined.expect b/pkg/front_end/parser_testcases/augmentation/member_errors.dart.intertwined.expect
index 4329287..50a8496 100644
--- a/pkg/front_end/parser_testcases/augmentation/member_errors.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/augmentation/member_errors.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Class, DeclarationKind.Class, Class)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Class)
               parseMetadataStar({)
                 listener: beginMetadataStar(augment)
@@ -55,11 +55,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassMethod(null, augment, (, null, })
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Class)
               parseMetadataStar(})
                 listener: beginMetadataStar(augment)
@@ -91,7 +91,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassMethod(null, augment, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, external)
+            notEofOrType(CLOSE_CURLY_BRACKET, external)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(external)
@@ -123,7 +123,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassMethod(null, external, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(augment)
@@ -152,11 +152,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassMethod(null, augment, (, null, })
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Class)
               parseMetadataStar(})
                 listener: beginMetadataStar(augment)
@@ -187,7 +187,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassMethod(null, augment, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, external)
+            notEofOrType(CLOSE_CURLY_BRACKET, external)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(external)
@@ -218,7 +218,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassMethod(null, external, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(augment)
@@ -255,7 +255,7 @@
                     inGenerator()
                 listener: endClassMethod(get, augment, =>, null, ;)
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(augment)
@@ -283,7 +283,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassMethod(get, augment, ;, null, ;)
               listener: endMember()
-            notEofOrValue(}, external)
+            notEofOrType(CLOSE_CURLY_BRACKET, external)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(external)
@@ -311,7 +311,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassMethod(get, external, ;, null, ;)
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(augment)
@@ -350,7 +350,7 @@
                     inGenerator()
                 listener: endClassMethod(get, augment, =>, null, ;)
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(augment)
@@ -380,7 +380,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassMethod(get, augment, ;, null, ;)
               listener: endMember()
-            notEofOrValue(}, external)
+            notEofOrType(CLOSE_CURLY_BRACKET, external)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(external)
@@ -410,7 +410,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassMethod(get, external, ;, null, ;)
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(augment)
@@ -449,11 +449,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassMethod(set, augment, (, null, })
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Class)
               parseMetadataStar(})
                 listener: beginMetadataStar(augment)
@@ -494,7 +494,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassMethod(set, augment, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, external)
+            notEofOrType(CLOSE_CURLY_BRACKET, external)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(external)
@@ -535,7 +535,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassMethod(set, external, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(augment)
@@ -574,11 +574,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassMethod(set, augment, (, null, })
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Class)
               parseMetadataStar(})
                 listener: beginMetadataStar(augment)
@@ -619,7 +619,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassMethod(set, augment, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, external)
+            notEofOrType(CLOSE_CURLY_BRACKET, external)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(external)
@@ -660,7 +660,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassMethod(set, external, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(augment)
@@ -679,7 +679,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, augment, null, null, null, null, var, 1, augment, ;)
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(augment)
@@ -698,7 +698,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, augment, external, null, null, null, var, 1, augment, ;)
               listener: endMember()
-            notEofOrValue(}, external)
+            notEofOrType(CLOSE_CURLY_BRACKET, external)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(external)
@@ -717,7 +717,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, external, null, null, null, var, 1, external, ;)
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(augment)
@@ -743,7 +743,7 @@
                   listener: endFieldInitializer(=, 0)
                 listener: endClassFields(null, augment, null, null, null, null, final, 1, augment, ;)
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(augment)
@@ -762,7 +762,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, augment, external, null, null, null, final, 1, augment, ;)
               listener: endMember()
-            notEofOrValue(}, external)
+            notEofOrType(CLOSE_CURLY_BRACKET, external)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(external)
@@ -781,7 +781,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, external, null, null, null, final, 1, external, ;)
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(augment)
@@ -807,7 +807,7 @@
                   listener: endFieldInitializer(=, 0)
                 listener: endClassFields(null, augment, null, null, null, null, const, 1, augment, ;)
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(augment)
@@ -828,7 +828,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, augment, external, null, null, null, const, 1, augment, ;)
               listener: endMember()
-            notEofOrValue(}, external)
+            notEofOrType(CLOSE_CURLY_BRACKET, external)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(external)
@@ -849,7 +849,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, external, null, null, null, const, 1, external, ;)
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(augment)
@@ -868,7 +868,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, augment, null, null, null, null, null, 1, augment, ;)
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(augment)
@@ -887,7 +887,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, augment, external, null, null, null, null, 1, augment, ;)
               listener: endMember()
-            notEofOrValue(}, external)
+            notEofOrType(CLOSE_CURLY_BRACKET, external)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(external)
@@ -906,7 +906,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, external, null, null, null, null, 1, external, ;)
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(augment)
@@ -925,7 +925,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, augment, null, null, null, late, var, 1, augment, ;)
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(augment)
@@ -942,7 +942,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, augment, null, null, null, late, var, 1, augment, ;)
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(augment)
@@ -959,7 +959,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, augment, null, null, null, late, var, 1, augment, ;)
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(augment)
@@ -978,7 +978,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, augment, null, null, null, late, final, 1, augment, ;)
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(augment)
@@ -995,7 +995,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, augment, null, null, null, late, final, 1, augment, ;)
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(augment)
@@ -1012,7 +1012,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, augment, null, null, null, late, final, 1, augment, ;)
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(augment)
@@ -1031,7 +1031,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, augment, null, null, null, late, null, 1, augment, ;)
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(augment)
@@ -1048,7 +1048,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, augment, null, null, null, late, null, 1, augment, ;)
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(augment)
@@ -1065,7 +1065,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, augment, null, null, null, late, null, 1, augment, ;)
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(augment)
@@ -1094,11 +1094,11 @@
                   inPlainSync()
                 parseFunctionBody(), false, false)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassMethod(null, augment, (, null, })
               listener: endMember()
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Class)
               parseMetadataStar(})
                 listener: beginMetadataStar(static)
@@ -1127,11 +1127,11 @@
                   inPlainSync()
                 parseFunctionBody(), false, false)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassMethod(null, static, (, null, })
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Class)
               parseMetadataStar(})
                 listener: beginMetadataStar(augment)
@@ -1159,11 +1159,11 @@
                   inPlainSync()
                 parseFunctionBody(), false, false)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassMethod(null, augment, (, null, })
               listener: endMember()
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Class)
               parseMetadataStar(})
                 listener: beginMetadataStar(static)
@@ -1191,11 +1191,11 @@
                   inPlainSync()
                 parseFunctionBody(), false, false)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassMethod(null, static, (, null, })
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Class)
               parseMetadataStar(})
                 listener: beginMetadataStar(augment)
@@ -1231,7 +1231,7 @@
                     inGenerator()
                 listener: endClassMethod(get, augment, =>, null, ;)
               listener: endMember()
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(static)
@@ -1267,7 +1267,7 @@
                     inGenerator()
                 listener: endClassMethod(get, static, =>, null, ;)
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(augment)
@@ -1305,7 +1305,7 @@
                     inGenerator()
                 listener: endClassMethod(get, augment, =>, null, ;)
               listener: endMember()
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(static)
@@ -1343,7 +1343,7 @@
                     inGenerator()
                 listener: endClassMethod(get, static, =>, null, ;)
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(augment)
@@ -1381,11 +1381,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, false)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassMethod(set, augment, (, null, })
               listener: endMember()
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Class)
               parseMetadataStar(})
                 listener: beginMetadataStar(static)
@@ -1423,11 +1423,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, false)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassMethod(set, static, (, null, })
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Class)
               parseMetadataStar(})
                 listener: beginMetadataStar(augment)
@@ -1465,11 +1465,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, false)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassMethod(set, augment, (, null, })
               listener: endMember()
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Class)
               parseMetadataStar(})
                 listener: beginMetadataStar(static)
@@ -1507,11 +1507,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, false)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassMethod(set, static, (, null, })
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Class)
               parseMetadataStar(})
                 listener: beginMetadataStar(augment)
@@ -1530,7 +1530,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, augment, null, static, null, null, var, 1, augment, ;)
               listener: endMember()
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(static)
@@ -1549,7 +1549,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, static, null, null, var, 1, static, ;)
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(augment)
@@ -1575,7 +1575,7 @@
                   listener: endFieldInitializer(=, 0)
                 listener: endClassFields(null, augment, null, static, null, null, final, 1, augment, ;)
               listener: endMember()
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(static)
@@ -1601,7 +1601,7 @@
                   listener: endFieldInitializer(=, 0)
                 listener: endClassFields(null, null, null, static, null, null, final, 1, static, ;)
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(augment)
@@ -1627,7 +1627,7 @@
                   listener: endFieldInitializer(=, 0)
                 listener: endClassFields(null, augment, null, static, null, null, const, 1, augment, ;)
               listener: endMember()
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(static)
@@ -1653,7 +1653,7 @@
                   listener: endFieldInitializer(=, 0)
                 listener: endClassFields(null, null, null, static, null, null, const, 1, static, ;)
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(augment)
@@ -1672,7 +1672,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, augment, null, static, null, null, null, 1, augment, ;)
               listener: endMember()
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(static)
@@ -1691,7 +1691,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, static, null, null, null, 1, static, ;)
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(augment)
@@ -1710,7 +1710,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, augment, null, static, null, late, var, 1, augment, ;)
               listener: endMember()
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(static)
@@ -1729,7 +1729,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, static, null, late, var, 1, static, ;)
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(augment)
@@ -1748,7 +1748,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, augment, null, static, null, late, final, 1, augment, ;)
               listener: endMember()
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(static)
@@ -1767,7 +1767,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, static, null, late, final, 1, static, ;)
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(augment)
@@ -1786,7 +1786,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, augment, null, static, null, late, null, 1, augment, ;)
               listener: endMember()
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(static)
@@ -1805,7 +1805,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, static, null, late, null, 1, static, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 65, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/augmentation/top_level_declarations.dart.intertwined.expect b/pkg/front_end/parser_testcases/augmentation/top_level_declarations.dart.intertwined.expect
index 9fd719f..8036138 100644
--- a/pkg/front_end/parser_testcases/augmentation/top_level_declarations.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/augmentation/top_level_declarations.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(augment, null, })
   listener: endTopLevelDeclaration(})
@@ -53,7 +53,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(augment, null, })
   listener: endTopLevelDeclaration(})
@@ -156,7 +156,7 @@
         inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(augment, set, })
   listener: endTopLevelDeclaration(})
@@ -193,7 +193,7 @@
         inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(augment, set, })
   listener: endTopLevelDeclaration(})
@@ -353,7 +353,7 @@
             listener: handleClassHeader(augment, class, null)
           parseClassOrMixinOrExtensionBody(Class, DeclarationKind.Class, Class)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(augment, })
   listener: endTopLevelDeclaration(})
@@ -380,7 +380,7 @@
             listener: handleClassHeader(augment, class, null)
           parseClassOrMixinOrExtensionBody(Class, DeclarationKind.Class, Class)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(augment, })
   listener: endTopLevelDeclaration(})
@@ -455,7 +455,7 @@
           listener: handleMixinHeader(mixin)
         parseClassOrMixinOrExtensionBody(Mixin, DeclarationKind.Mixin, Mixin)
           listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Mixin, {)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endClassOrMixinOrExtensionBody(DeclarationKind.Mixin, 0, {, })
         listener: endMixinDeclaration(augment, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/augmentation/top_level_errors.dart.intertwined.expect b/pkg/front_end/parser_testcases/augmentation/top_level_errors.dart.intertwined.expect
index c534752..822d4fe 100644
--- a/pkg/front_end/parser_testcases/augmentation/top_level_errors.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/augmentation/top_level_errors.dart.intertwined.expect
@@ -28,7 +28,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(augment, null, })
   listener: endTopLevelDeclaration(})
@@ -113,7 +113,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(augment, null, })
   listener: endTopLevelDeclaration(})
@@ -378,7 +378,7 @@
         inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(augment, set, })
   listener: endTopLevelDeclaration(})
@@ -493,7 +493,7 @@
         inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(augment, set, })
   listener: endTopLevelDeclaration(})
@@ -717,7 +717,7 @@
             listener: handleClassHeader(augment, class, null)
           parseClassOrMixinOrExtensionBody(Class, DeclarationKind.Class, Class)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(augment, })
   listener: endTopLevelDeclaration(})
@@ -746,7 +746,7 @@
             listener: handleClassHeader(abstract, class, null)
           parseClassOrMixinOrExtensionBody(Class, DeclarationKind.Class, Class)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(abstract, })
   listener: endTopLevelDeclaration(})
@@ -827,7 +827,7 @@
           listener: handleMixinHeader(mixin)
         parseClassOrMixinOrExtensionBody(Mixin, DeclarationKind.Mixin, Mixin)
           listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Mixin, {)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endClassOrMixinOrExtensionBody(DeclarationKind.Mixin, 0, {, })
         listener: endMixinDeclaration(augment, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/class_modifiers/base/base_class_declaration.dart.intertwined.expect b/pkg/front_end/parser_testcases/class_modifiers/base/base_class_declaration.dart.intertwined.expect
index 44d747e..f407a64 100644
--- a/pkg/front_end/parser_testcases/class_modifiers/base/base_class_declaration.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/class_modifiers/base/base_class_declaration.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(base, class, null)
           parseClassOrMixinOrExtensionBody(A, DeclarationKind.Class, A)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(base, })
   listener: endTopLevelDeclaration(})
@@ -52,7 +52,7 @@
             listener: handleClassHeader(abstract, class, null)
           parseClassOrMixinOrExtensionBody(B, DeclarationKind.Class, B)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(abstract, })
   listener: endTopLevelDeclaration(})
@@ -75,7 +75,7 @@
           listener: handleMixinHeader(mixin)
         parseClassOrMixinOrExtensionBody(M, DeclarationKind.Mixin, M)
           listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Mixin, {)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endClassOrMixinOrExtensionBody(DeclarationKind.Mixin, 0, {, })
         listener: endMixinDeclaration(base, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/class_modifiers/final/final_class_declaration.dart.intertwined.expect b/pkg/front_end/parser_testcases/class_modifiers/final/final_class_declaration.dart.intertwined.expect
index 3c82187..14615fe 100644
--- a/pkg/front_end/parser_testcases/class_modifiers/final/final_class_declaration.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/class_modifiers/final/final_class_declaration.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(final, class, null)
           parseClassOrMixinOrExtensionBody(A, DeclarationKind.Class, A)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(final, })
   listener: endTopLevelDeclaration(})
@@ -52,7 +52,7 @@
             listener: handleClassHeader(abstract, class, null)
           parseClassOrMixinOrExtensionBody(B, DeclarationKind.Class, B)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(abstract, })
   listener: endTopLevelDeclaration(})
@@ -75,7 +75,7 @@
           listener: handleMixinHeader(mixin)
         parseClassOrMixinOrExtensionBody(M, DeclarationKind.Mixin, M)
           listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Mixin, {)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endClassOrMixinOrExtensionBody(DeclarationKind.Mixin, 0, {, })
         listener: endMixinDeclaration(mixin, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/class_modifiers/interface/interface_class_declaration.dart.intertwined.expect b/pkg/front_end/parser_testcases/class_modifiers/interface/interface_class_declaration.dart.intertwined.expect
index eae693e..97cc780 100644
--- a/pkg/front_end/parser_testcases/class_modifiers/interface/interface_class_declaration.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/class_modifiers/interface/interface_class_declaration.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(interface, class, null)
           parseClassOrMixinOrExtensionBody(A, DeclarationKind.Class, A)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(interface, })
   listener: endTopLevelDeclaration(})
@@ -52,7 +52,7 @@
             listener: handleClassHeader(abstract, class, null)
           parseClassOrMixinOrExtensionBody(B, DeclarationKind.Class, B)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(abstract, })
   listener: endTopLevelDeclaration(})
@@ -75,7 +75,7 @@
           listener: handleMixinHeader(mixin)
         parseClassOrMixinOrExtensionBody(M, DeclarationKind.Mixin, M)
           listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Mixin, {)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endClassOrMixinOrExtensionBody(DeclarationKind.Mixin, 0, {, })
         listener: endMixinDeclaration(mixin, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/class_modifiers/mixin/mixin_class.dart.intertwined.expect b/pkg/front_end/parser_testcases/class_modifiers/mixin/mixin_class.dart.intertwined.expect
index 4622d7e..f766855 100644
--- a/pkg/front_end/parser_testcases/class_modifiers/mixin/mixin_class.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/class_modifiers/mixin/mixin_class.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(mixin, class, null)
           parseClassOrMixinOrExtensionBody(A, DeclarationKind.Class, A)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(mixin, })
   listener: endTopLevelDeclaration(})
@@ -52,7 +52,7 @@
             listener: handleClassHeader(abstract, class, null)
           parseClassOrMixinOrExtensionBody(B, DeclarationKind.Class, B)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(abstract, })
   listener: endTopLevelDeclaration(})
@@ -75,7 +75,7 @@
           listener: handleMixinHeader(mixin)
         parseClassOrMixinOrExtensionBody(M, DeclarationKind.Mixin, M)
           listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Mixin, {)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endClassOrMixinOrExtensionBody(DeclarationKind.Mixin, 0, {, })
         listener: endMixinDeclaration(mixin, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/coverage/bar_eq.dart.intertwined.expect b/pkg/front_end/parser_testcases/coverage/bar_eq.dart.intertwined.expect
index 2625712..8568a97 100644
--- a/pkg/front_end/parser_testcases/coverage/bar_eq.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/coverage/bar_eq.dart.intertwined.expect
@@ -37,7 +37,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, bar)
+          notEofOrType(CLOSE_CURLY_BRACKET, bar)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -49,7 +49,6 @@
                         parsePrimary({, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(bar, expression)
                               listener: handleNoTypeArguments(|=)
@@ -64,7 +63,7 @@
                       listener: handleAssignmentExpression(|=, 2)
                   ensureSemicolon(2)
                   listener: handleExpressionStatement(bar, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/coverage/interpolated_eof.dart.intertwined.expect b/pkg/front_end/parser_testcases/coverage/interpolated_eof.dart.intertwined.expect
index 2e45a95..193f9ff 100644
--- a/pkg/front_end/parser_testcases/coverage/interpolated_eof.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/coverage/interpolated_eof.dart.intertwined.expect
@@ -25,7 +25,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, print)
+          notEofOrType(CLOSE_CURLY_BRACKET, print)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -38,7 +38,6 @@
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(})
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(print, expression)
                               listener: handleNoTypeArguments(()
@@ -74,7 +73,7 @@
                       listener: // WARNING: Reporting at eof for .
                     rewriter()
                   listener: handleExpressionStatement(print, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/coverage/numbers.dart.intertwined.expect b/pkg/front_end/parser_testcases/coverage/numbers.dart.intertwined.expect
index 7bfa8bc..6b2182f 100644
--- a/pkg/front_end/parser_testcases/coverage/numbers.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/coverage/numbers.dart.intertwined.expect
@@ -25,7 +25,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, 12_e0)
+          notEofOrType(CLOSE_CURLY_BRACKET, 12_e0)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -40,7 +40,7 @@
                               listener: handleLiteralDoubleWithSeparators(12_e0)
                     ensureSemicolon(12_e0)
                     listener: handleExpressionStatement(12_e0, ;)
-          notEofOrValue(}, 12_E0)
+          notEofOrType(CLOSE_CURLY_BRACKET, 12_E0)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -55,7 +55,7 @@
                               listener: handleLiteralDoubleWithSeparators(12_E0)
                     ensureSemicolon(12_E0)
                     listener: handleExpressionStatement(12_E0, ;)
-          notEofOrValue(}, 12_)
+          notEofOrType(CLOSE_CURLY_BRACKET, 12_)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -70,7 +70,6 @@
                               listener: handleLiteralIntWithSeparators(12_)
                         parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                           parseSend(., expressionContinuation, ConstantPatternContext.none)
-                            isNextIdentifier(.)
                             ensureIdentifier(., expressionContinuation)
                               reportRecoverableErrorWithToken(;, Template(ExpectedIdentifier))
                                 listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got ';'., Try inserting an identifier before ';'., {lexeme: ;}], ;, ;)
@@ -83,7 +82,7 @@
                         listener: handleEndingBinaryExpression(., )
                     ensureSemicolon()
                     listener: handleExpressionStatement(12_, ;)
-          notEofOrValue(}, 12_)
+          notEofOrType(CLOSE_CURLY_BRACKET, 12_)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -98,7 +97,7 @@
                               listener: handleLiteralIntWithSeparators(12_)
                     ensureSemicolon(12_)
                     listener: handleExpressionStatement(12_, ;)
-          notEofOrValue(}, 0x_0)
+          notEofOrType(CLOSE_CURLY_BRACKET, 0x_0)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -113,7 +112,7 @@
                               listener: handleLiteralInt(0x_0)
                     ensureSemicolon(0x_0)
                     listener: handleExpressionStatement(0x_0, ;)
-          notEofOrValue(}, 0xA_)
+          notEofOrType(CLOSE_CURLY_BRACKET, 0xA_)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -128,7 +127,7 @@
                               listener: handleLiteralIntWithSeparators(0xA_)
                     ensureSemicolon(0xA_)
                     listener: handleExpressionStatement(0xA_, ;)
-          notEofOrValue(}, .1)
+          notEofOrType(CLOSE_CURLY_BRACKET, .1)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -143,7 +142,7 @@
                               listener: handleLiteralDouble(.1)
                     ensureSemicolon(.1)
                     listener: handleExpressionStatement(.1, ;)
-          notEofOrValue(}, 1.2_)
+          notEofOrType(CLOSE_CURLY_BRACKET, 1.2_)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -158,7 +157,7 @@
                               listener: handleLiteralDoubleWithSeparators(1.2_)
                     ensureSemicolon(1.2_)
                     listener: handleExpressionStatement(1.2_, ;)
-          notEofOrValue(}, 1.2_e0)
+          notEofOrType(CLOSE_CURLY_BRACKET, 1.2_e0)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -173,7 +172,7 @@
                               listener: handleLiteralDoubleWithSeparators(1.2_e0)
                     ensureSemicolon(1.2_e0)
                     listener: handleExpressionStatement(1.2_e0, ;)
-          notEofOrValue(}, 1.2_E0)
+          notEofOrType(CLOSE_CURLY_BRACKET, 1.2_E0)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -188,7 +187,7 @@
                               listener: handleLiteralDoubleWithSeparators(1.2_E0)
                     ensureSemicolon(1.2_E0)
                     listener: handleExpressionStatement(1.2_E0, ;)
-          notEofOrValue(}, 1.2e_0)
+          notEofOrType(CLOSE_CURLY_BRACKET, 1.2e_0)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -203,7 +202,7 @@
                               listener: handleLiteralDoubleWithSeparators(1.2e_0)
                     ensureSemicolon(1.2e_0)
                     listener: handleExpressionStatement(1.2e_0, ;)
-          notEofOrValue(}, 1.2E_0)
+          notEofOrType(CLOSE_CURLY_BRACKET, 1.2E_0)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -218,7 +217,7 @@
                               listener: handleLiteralDoubleWithSeparators(1.2E_0)
                     ensureSemicolon(1.2E_0)
                     listener: handleExpressionStatement(1.2E_0, ;)
-          notEofOrValue(}, 1.2e-_0)
+          notEofOrType(CLOSE_CURLY_BRACKET, 1.2e-_0)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -233,7 +232,7 @@
                               listener: handleLiteralDoubleWithSeparators(1.2e-_0)
                     ensureSemicolon(1.2e-_0)
                     listener: handleExpressionStatement(1.2e-_0, ;)
-          notEofOrValue(}, 1.2E-_0)
+          notEofOrType(CLOSE_CURLY_BRACKET, 1.2E-_0)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -248,7 +247,7 @@
                               listener: handleLiteralDoubleWithSeparators(1.2E-_0)
                     ensureSemicolon(1.2E-_0)
                     listener: handleExpressionStatement(1.2E-_0, ;)
-          notEofOrValue(}, 1.2e-1_)
+          notEofOrType(CLOSE_CURLY_BRACKET, 1.2e-1_)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -263,7 +262,7 @@
                               listener: handleLiteralDoubleWithSeparators(1.2e-1_)
                     ensureSemicolon(1.2e-1_)
                     listener: handleExpressionStatement(1.2e-1_, ;)
-          notEofOrValue(}, 1.2E-1_)
+          notEofOrType(CLOSE_CURLY_BRACKET, 1.2E-1_)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -278,7 +277,7 @@
                               listener: handleLiteralDoubleWithSeparators(1.2E-1_)
                     ensureSemicolon(1.2E-1_)
                     listener: handleExpressionStatement(1.2E-1_, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(16, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/coverage/slash_eq.dart.intertwined.expect b/pkg/front_end/parser_testcases/coverage/slash_eq.dart.intertwined.expect
index 6b1c40a..a2e00a8 100644
--- a/pkg/front_end/parser_testcases/coverage/slash_eq.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/coverage/slash_eq.dart.intertwined.expect
@@ -39,7 +39,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement({)
             parseStatementX({)
               parseReturnStatement({)
@@ -50,7 +50,6 @@
                       parsePrimary(return, expression, ConstantPatternContext.none)
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               listener: handleIdentifier(bar, expression)
                             listener: handleNoTypeArguments(/=)
@@ -66,7 +65,7 @@
                 ensureSemicolon(2)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(dynamic, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/coverage/string1.dart.intertwined.expect b/pkg/front_end/parser_testcases/coverage/string1.dart.intertwined.expect
index a95c137..5616625 100644
--- a/pkg/front_end/parser_testcases/coverage/string1.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/coverage/string1.dart.intertwined.expect
@@ -39,7 +39,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement({)
             parseStatementX({)
               parseReturnStatement({)
@@ -53,7 +53,6 @@
                             listener: beginLiteralString("æble )
                             parseIdentifierExpression($)
                               parseSend($, expression, ConstantPatternContext.none)
-                                isNextIdentifier($)
                                 ensureIdentifier($, expression)
                                   listener: handleIdentifier(bar, expression)
                                 listener: handleNoTypeArguments(")
@@ -67,7 +66,7 @@
                 ensureSemicolon(")
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(String, null, })
   listener: endTopLevelDeclaration(})
@@ -96,7 +95,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement({)
             parseStatementX({)
               parseReturnStatement({)
@@ -115,7 +114,7 @@
                   rewriter()
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(String, null, })
   listener: endTopLevelDeclaration(})
@@ -144,7 +143,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement({)
             parseStatementX({)
               parseReturnStatement({)
@@ -158,7 +157,6 @@
                             listener: beginLiteralString(")
                             parseIdentifierExpression($)
                               parseSend($, expression, ConstantPatternContext.none)
-                                isNextIdentifier($)
                                 ensureIdentifier($, expression)
                                   listener: handleIdentifier(, expression)
                                 listener: handleNoTypeArguments(1")
@@ -175,7 +173,7 @@
                   rewriter()
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(String, null, })
   listener: endTopLevelDeclaration(})
@@ -204,7 +202,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement({)
             parseStatementX({)
               parseReturnStatement({)
@@ -223,7 +221,7 @@
                   rewriter()
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(String, null, })
   listener: endTopLevelDeclaration(})
@@ -252,7 +250,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement({)
             parseStatementX({)
               parseReturnStatement({)
@@ -271,7 +269,7 @@
                   rewriter()
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(String, null, })
   listener: endTopLevelDeclaration(})
@@ -300,7 +298,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement({)
             parseStatementX({)
               parseReturnStatement({)
@@ -319,7 +317,7 @@
                   rewriter()
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(String, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/coverage/string2.dart.intertwined.expect b/pkg/front_end/parser_testcases/coverage/string2.dart.intertwined.expect
index 3eaaaa7..c85b4a3 100644
--- a/pkg/front_end/parser_testcases/coverage/string2.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/coverage/string2.dart.intertwined.expect
@@ -37,7 +37,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement({)
             parseStatementX({)
               parseReturnStatement({)
@@ -51,7 +51,6 @@
                             listener: beginLiteralString("""æbler)
                             parseIdentifierExpression($)
                               parseSend($, expression, ConstantPatternContext.none)
-                                isNextIdentifier($)
                                 ensureIdentifier($, expression)
                                   listener: handleIdentifier(bar, expression)
                                 listener: handleNoTypeArguments(""")
@@ -68,7 +67,7 @@
                   rewriter()
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -95,7 +94,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement({)
             parseStatementX({)
               parseReturnStatement({)
@@ -114,7 +113,7 @@
                   rewriter()
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -141,7 +140,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement({)
             parseStatementX({)
               parseReturnStatement({)
@@ -160,7 +159,7 @@
                   rewriter()
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -187,7 +186,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement({)
             parseStatementX({)
               parseReturnStatement({)
@@ -216,7 +215,7 @@
                   rewriter()
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -243,7 +242,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement({)
             parseStatementX({)
               parseReturnStatement({)
@@ -262,7 +261,7 @@
                   rewriter()
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/coverage/string3.dart.intertwined.expect b/pkg/front_end/parser_testcases/coverage/string3.dart.intertwined.expect
index 77b1af7..c8f7b26 100644
--- a/pkg/front_end/parser_testcases/coverage/string3.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/coverage/string3.dart.intertwined.expect
@@ -25,7 +25,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement({)
             parseStatementX({)
               parseReturnStatement({)
@@ -49,7 +49,7 @@
                   rewriter()
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/coverage/string4.dart.intertwined.expect b/pkg/front_end/parser_testcases/coverage/string4.dart.intertwined.expect
index f13e979..6540686 100644
--- a/pkg/front_end/parser_testcases/coverage/string4.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/coverage/string4.dart.intertwined.expect
@@ -25,7 +25,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement({)
             parseStatementX({)
               parseReturnStatement({)
@@ -45,7 +45,7 @@
 æbler""")
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -72,7 +72,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement({)
             parseStatementX({)
               parseReturnStatement({)
@@ -96,7 +96,7 @@
                   rewriter()
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/coverage/tag_non_ascii.dart.intertwined.expect b/pkg/front_end/parser_testcases/coverage/tag_non_ascii.dart.intertwined.expect
index a7e308a..675e232 100644
--- a/pkg/front_end/parser_testcases/coverage/tag_non_ascii.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/coverage/tag_non_ascii.dart.intertwined.expect
@@ -27,7 +27,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/dot_shorthands/no_identifier_no_context_recovery.dart.intertwined.expect b/pkg/front_end/parser_testcases/dot_shorthands/no_identifier_no_context_recovery.dart.intertwined.expect
index 7ff454f..aa86b5b 100644
--- a/pkg/front_end/parser_testcases/dot_shorthands/no_identifier_no_context_recovery.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/dot_shorthands/no_identifier_no_context_recovery.dart.intertwined.expect
@@ -84,7 +84,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
@@ -113,7 +113,7 @@
                     listener: endInitializedIdentifier(c)
                   ensureSemicolon()
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/dot_shorthands/no_identifier_recovery.dart.intertwined.expect b/pkg/front_end/parser_testcases/dot_shorthands/no_identifier_recovery.dart.intertwined.expect
index 7ff454f..aa86b5b 100644
--- a/pkg/front_end/parser_testcases/dot_shorthands/no_identifier_recovery.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/dot_shorthands/no_identifier_recovery.dart.intertwined.expect
@@ -84,7 +84,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
@@ -113,7 +113,7 @@
                     listener: endInitializedIdentifier(c)
                   ensureSemicolon()
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/dot_shorthands/syntax.dart.intertwined.expect b/pkg/front_end/parser_testcases/dot_shorthands/syntax.dart.intertwined.expect
index 10a25c4..1abb9d1 100644
--- a/pkg/front_end/parser_testcases/dot_shorthands/syntax.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/dot_shorthands/syntax.dart.intertwined.expect
@@ -84,7 +84,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, Color)
+          notEofOrType(CLOSE_CURLY_BRACKET, Color)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -107,7 +107,6 @@
                           parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                               parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                isNextIdentifier(.)
                                 ensureIdentifier(., expressionContinuation)
                                   listener: handleIdentifier(red, expressionContinuation)
                                 listener: handleNoTypeArguments(;)
@@ -120,7 +119,7 @@
                     listener: endInitializedIdentifier(c)
                   ensureSemicolon(red)
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/enhanced_enums/entries_with_type_arguments.dart.intertwined.expect b/pkg/front_end/parser_testcases/enhanced_enums/entries_with_type_arguments.dart.intertwined.expect
index 000df20..aa7038b 100644
--- a/pkg/front_end/parser_testcases/enhanced_enums/entries_with_type_arguments.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/enhanced_enums/entries_with_type_arguments.dart.intertwined.expect
@@ -114,7 +114,7 @@
               listener: endArguments(1, (, ))
           listener: handleEnumElement(,, null)
         listener: handleEnumElements(;, 3)
-        notEofOrValue(}, const)
+        notEofOrType(CLOSE_CURLY_BRACKET, const)
         parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Enum, E)
           parseMetadataStar(;)
             listener: beginMetadataStar(const)
@@ -145,7 +145,7 @@
               listener: handleEmptyFunctionBody(;)
             listener: endEnumConstructor(null, const, (, null, ;)
           listener: endMember()
-        notEofOrValue(}, const)
+        notEofOrType(CLOSE_CURLY_BRACKET, const)
         parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Enum, E)
           parseMetadataStar(;)
             listener: beginMetadataStar(const)
@@ -192,7 +192,7 @@
               listener: handleEmptyFunctionBody(;)
             listener: endEnumConstructor(null, const, (, null, ;)
           listener: endMember()
-        notEofOrValue(}, })
+        notEofOrType(CLOSE_CURLY_BRACKET, })
         listener: endEnum(enum, enum, {, 2, })
   listener: endTopLevelDeclaration(})
   reportAllErrorTokens(enum)
diff --git a/pkg/front_end/parser_testcases/error_recovery/await_not_in_async.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/await_not_in_async.dart.intertwined.expect
index 0009cfb..e526392 100644
--- a/pkg/front_end/parser_testcases/error_recovery/await_not_in_async.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/await_not_in_async.dart.intertwined.expect
@@ -36,7 +36,6 @@
                   parsePrimary(=>, expression, ConstantPatternContext.none)
                     parseSendOrFunctionLiteral(=>, expression, ConstantPatternContext.none)
                       parseSend(=>, expression, ConstantPatternContext.none)
-                        isNextIdentifier(=>)
                         ensureIdentifier(=>, expression)
                           listener: handleIdentifier(Future, expression)
                         listener: handleNoTypeArguments(.)
@@ -46,7 +45,6 @@
                 parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                   parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                     parseSend(., expressionContinuation, ConstantPatternContext.none)
-                      isNextIdentifier(.)
                       ensureIdentifier(., expressionContinuation)
                         listener: handleIdentifier(value, expressionContinuation)
                       listener: handleNoTypeArguments(()
@@ -85,7 +83,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, await)
+          notEofOrType(CLOSE_CURLY_BRACKET, await)
           parseStatement({)
             parseStatementX({)
               inPlainSync()
@@ -106,7 +104,6 @@
                               parseSendOrFunctionLiteral(await, expression, ConstantPatternContext.none)
                                 looksLikeFunctionBody(;)
                                 parseSend(await, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(await)
                                   ensureIdentifier(await, expression)
                                     listener: handleIdentifier(f, expression)
                                   listener: handleNoTypeArguments(()
@@ -122,7 +119,7 @@
                         listener: endInvalidAwaitExpression(await, ), AwaitNotAsync)
                 ensureSemicolon())
                 listener: handleExpressionStatement(await, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/bad_variable_in_if.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/bad_variable_in_if.dart.intertwined.expect
index cc15750..a7e42c5 100644
--- a/pkg/front_end/parser_testcases/error_recovery/bad_variable_in_if.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/bad_variable_in_if.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -86,7 +86,7 @@
                         listener: endVariablesDeclaration(1, ;)
                 listener: endThenStatement(final, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(foo, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/bracket_mismatch_00.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/bracket_mismatch_00.dart.intertwined.expect
index fc1419b..9d8eb3c 100644
--- a/pkg/front_end/parser_testcases/error_recovery/bracket_mismatch_00.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/bracket_mismatch_00.dart.intertwined.expect
@@ -25,7 +25,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, [)
+          notEofOrType(CLOSE_CURLY_BRACKET, [)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -57,7 +57,7 @@
                               listener: handleLiteralList(1, [, null, ])
                     ensureSemicolon(])
                     listener: handleExpressionStatement([, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -84,7 +84,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, [)
+          notEofOrType(CLOSE_CURLY_BRACKET, [)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -109,7 +109,6 @@
                                               parseUnaryExpression((, true, ConstantPatternContext.none)
                                                 parsePrimary((, expression, ConstantPatternContext.none)
                                                   parseSend((, expression, ConstantPatternContext.none)
-                                                    isNextIdentifier(()
                                                     ensureIdentifier((, expression)
                                                       reportRecoverableErrorWithToken(], Template(ExpectedIdentifier))
                                                         listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got ']'., Try inserting an identifier before ']'., {lexeme: ]}], ], ])
@@ -126,7 +125,7 @@
                               listener: handleLiteralList(1, [, null, ])
                     ensureSemicolon(])
                     listener: handleExpressionStatement([, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/bracket_mismatch_01.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/bracket_mismatch_01.dart.intertwined.expect
index d3919d9..bd5bb4b 100644
--- a/pkg/front_end/parser_testcases/error_recovery/bracket_mismatch_01.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/bracket_mismatch_01.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(C, DeclarationKind.Class, C)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, C)
+            notEofOrType(CLOSE_CURLY_BRACKET, C)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, C)
               parseMetadataStar({)
                 listener: beginMetadataStar(C)
@@ -69,7 +69,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, C, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, C)
+            notEofOrType(CLOSE_CURLY_BRACKET, C)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, C)
               parseMetadataStar(;)
                 listener: beginMetadataStar(C)
@@ -98,7 +98,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement({)
                     parseStatementX({)
                       parseReturnStatement({)
@@ -110,7 +110,6 @@
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody(;)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       listener: handleIdentifier(C, expression)
                                     listener: handleNoTypeArguments(()
@@ -133,7 +132,6 @@
                                                             parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                                               looksLikeFunctionBody(,)
                                                               parseSend([, expression, ConstantPatternContext.none)
-                                                                isNextIdentifier([)
                                                                 ensureIdentifier([, expression)
                                                                   listener: handleIdentifier(C, expression)
                                                                 listener: handleNoTypeArguments(()
@@ -156,7 +154,6 @@
                                                                                         parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                                                                           looksLikeFunctionBody(,)
                                                                                           parseSend([, expression, ConstantPatternContext.none)
-                                                                                            isNextIdentifier([)
                                                                                             ensureIdentifier([, expression)
                                                                                               listener: handleIdentifier(C, expression)
                                                                                             listener: handleNoTypeArguments(()
@@ -173,7 +170,6 @@
                                                                                         parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                                                                           looksLikeFunctionBody(,)
                                                                                           parseSend(,, expression, ConstantPatternContext.none)
-                                                                                            isNextIdentifier(,)
                                                                                             ensureIdentifier(,, expression)
                                                                                               listener: handleIdentifier(C, expression)
                                                                                             listener: handleNoTypeArguments(()
@@ -190,7 +186,6 @@
                                                                                         parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                                                                           looksLikeFunctionBody(,)
                                                                                           parseSend(,, expression, ConstantPatternContext.none)
-                                                                                            isNextIdentifier(,)
                                                                                             ensureIdentifier(,, expression)
                                                                                               listener: handleIdentifier(C, expression)
                                                                                             listener: handleNoTypeArguments(()
@@ -211,7 +206,6 @@
                                                             parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                                               looksLikeFunctionBody(,)
                                                               parseSend(,, expression, ConstantPatternContext.none)
-                                                                isNextIdentifier(,)
                                                                 ensureIdentifier(,, expression)
                                                                   listener: handleIdentifier(C, expression)
                                                                 listener: handleNoTypeArguments(()
@@ -228,7 +222,6 @@
                                                             parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                                               looksLikeFunctionBody(,)
                                                               parseSend(,, expression, ConstantPatternContext.none)
-                                                                isNextIdentifier(,)
                                                                 ensureIdentifier(,, expression)
                                                                   listener: handleIdentifier(C, expression)
                                                                 listener: handleNoTypeArguments(()
@@ -245,11 +238,11 @@
                         ensureSemicolon())
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(null, C, (, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 2, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -276,7 +269,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(D, DeclarationKind.Class, D)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, D)
+            notEofOrType(CLOSE_CURLY_BRACKET, D)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, D)
               parseMetadataStar({)
                 listener: beginMetadataStar(D)
@@ -320,7 +313,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, D, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, D)
+            notEofOrType(CLOSE_CURLY_BRACKET, D)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, D)
               parseMetadataStar(;)
                 listener: beginMetadataStar(D)
@@ -349,7 +342,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement({)
                     parseStatementX({)
                       parseReturnStatement({)
@@ -361,7 +354,6 @@
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody(;)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       listener: handleIdentifier(D, expression)
                                     listener: handleNoTypeArguments(()
@@ -384,7 +376,6 @@
                                                             parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                                               looksLikeFunctionBody(,)
                                                               parseSend([, expression, ConstantPatternContext.none)
-                                                                isNextIdentifier([)
                                                                 ensureIdentifier([, expression)
                                                                   listener: handleIdentifier(D, expression)
                                                                 listener: handleNoTypeArguments(()
@@ -401,7 +392,6 @@
                                                                               parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                                                                 looksLikeFunctionBody(,)
                                                                                 parseSend(:, expression, ConstantPatternContext.none)
-                                                                                  isNextIdentifier(:)
                                                                                   ensureIdentifier(:, expression)
                                                                                     listener: handleIdentifier(D, expression)
                                                                                   listener: handleNoTypeArguments(()
@@ -419,7 +409,6 @@
                                                                               parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                                                                 looksLikeFunctionBody(,)
                                                                                 parseSend(,, expression, ConstantPatternContext.none)
-                                                                                  isNextIdentifier(,)
                                                                                   ensureIdentifier(,, expression)
                                                                                     listener: handleIdentifier(D, expression)
                                                                                   listener: handleNoTypeArguments(()
@@ -436,7 +425,6 @@
                                                                               parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                                                                 looksLikeFunctionBody(,)
                                                                                 parseSend(,, expression, ConstantPatternContext.none)
-                                                                                  isNextIdentifier(,)
                                                                                   ensureIdentifier(,, expression)
                                                                                     listener: handleIdentifier(D, expression)
                                                                                   listener: handleNoTypeArguments(()
@@ -451,7 +439,6 @@
                                                                           parseUnaryExpression(,, true, ConstantPatternContext.none)
                                                                             parsePrimary(,, expression, ConstantPatternContext.none)
                                                                               parseSend(,, expression, ConstantPatternContext.none)
-                                                                                isNextIdentifier(,)
                                                                                 ensureIdentifier(,, expression)
                                                                                   reportRecoverableErrorWithToken(], Template(ExpectedIdentifier))
                                                                                     listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got ']'., Try inserting an identifier before ']'., {lexeme: ]}], ], ])
@@ -473,7 +460,6 @@
                                                             parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                                               looksLikeFunctionBody(,)
                                                               parseSend(,, expression, ConstantPatternContext.none)
-                                                                isNextIdentifier(,)
                                                                 ensureIdentifier(,, expression)
                                                                   listener: handleIdentifier(D, expression)
                                                                 listener: handleNoTypeArguments(()
@@ -490,7 +476,6 @@
                                                             parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                                               looksLikeFunctionBody(,)
                                                               parseSend(,, expression, ConstantPatternContext.none)
-                                                                isNextIdentifier(,)
                                                                 ensureIdentifier(,, expression)
                                                                   listener: handleIdentifier(D, expression)
                                                                 listener: handleNoTypeArguments(()
@@ -507,11 +492,11 @@
                         ensureSemicolon())
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(null, D, (, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 2, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/bracket_mismatch_02.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/bracket_mismatch_02.dart.intertwined.expect
index 0cfc341..59b5acf 100644
--- a/pkg/front_end/parser_testcases/error_recovery/bracket_mismatch_02.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/bracket_mismatch_02.dart.intertwined.expect
@@ -25,13 +25,13 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, {)
+          notEofOrType(CLOSE_CURLY_BRACKET, {)
           parseStatement({)
             parseStatementX({)
               parseBlock({, BlockKind(statement))
                 ensureBlock({, BlockKind(statement))
                 listener: beginBlock({, BlockKind(statement))
-                notEofOrValue(}, [)
+                notEofOrType(CLOSE_CURLY_BRACKET, [)
                 parseStatement({)
                   parseStatementX({)
                     parseExpressionStatementOrDeclaration({, null)
@@ -50,14 +50,14 @@
                               listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], [, [)
                             rewriter()
                           listener: handleExpressionStatement([, ;)
-                notEofOrValue(}, })
+                notEofOrType(CLOSE_CURLY_BRACKET, })
                 listener: endBlock(1, {, }, BlockKind(statement))
-          notEofOrValue(}, ;)
+          notEofOrType(CLOSE_CURLY_BRACKET, ;)
           parseStatement(})
             parseStatementX(})
               parseEmptyStatement(})
                 listener: handleEmptyStatement(;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/bracket_mismatch_03.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/bracket_mismatch_03.dart.intertwined.expect
index 97a973d..771c540 100644
--- a/pkg/front_end/parser_testcases/error_recovery/bracket_mismatch_03.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/bracket_mismatch_03.dart.intertwined.expect
@@ -25,13 +25,13 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, {)
+          notEofOrType(CLOSE_CURLY_BRACKET, {)
           parseStatement({)
             parseStatementX({)
               parseBlock({, BlockKind(statement))
                 ensureBlock({, BlockKind(statement))
                 listener: beginBlock({, BlockKind(statement))
-                notEofOrValue(}, foo)
+                notEofOrType(CLOSE_CURLY_BRACKET, foo)
                 parseStatement({)
                   parseStatementX({)
                     parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -44,7 +44,6 @@
                                 parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody())
                                   parseSend({, expression, ConstantPatternContext.none)
-                                    isNextIdentifier({)
                                     ensureIdentifier({, expression)
                                       listener: handleIdentifier(foo, expression)
                                     listener: handleNoTypeArguments(()
@@ -59,7 +58,7 @@
                             listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], ), ))
                           rewriter()
                         listener: handleExpressionStatement(foo, ;)
-                notEofOrValue(}, ))
+                notEofOrType(CLOSE_CURLY_BRACKET, ))
                 parseStatement(;)
                   parseStatementX(;)
                     parseExpressionStatementOrDeclaration(;, null)
@@ -71,7 +70,6 @@
                               parseUnaryExpression(;, true, ConstantPatternContext.none)
                                 parsePrimary(;, expression, ConstantPatternContext.none)
                                   parseSend(;, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(;)
                                     ensureIdentifier(;, expression)
                                       reportRecoverableErrorWithToken(), Template(ExpectedIdentifier))
                                         listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got ')'., Try inserting an identifier before ')'., {lexeme: )}], ), ))
@@ -88,14 +86,14 @@
                           listener: handleExpressionStatement(), ;)
                 reportRecoverableError(), Message[UnexpectedToken, Unexpected token ')'., null, {lexeme: )}])
                   listener: handleRecoverableError(Message[UnexpectedToken, Unexpected token ')'., null, {lexeme: )}], ), ))
-                notEofOrValue(}, ;)
+                notEofOrType(CLOSE_CURLY_BRACKET, ;)
                 parseStatement())
                   parseStatementX())
                     parseEmptyStatement())
                       listener: handleEmptyStatement(;)
-                notEofOrValue(}, })
+                notEofOrType(CLOSE_CURLY_BRACKET, })
                 listener: endBlock(3, {, }, BlockKind(statement))
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/bracket_mismatch_04.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/bracket_mismatch_04.dart.intertwined.expect
index 2e3072d..e702d2f 100644
--- a/pkg/front_end/parser_testcases/error_recovery/bracket_mismatch_04.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/bracket_mismatch_04.dart.intertwined.expect
@@ -25,7 +25,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, foo)
+          notEofOrType(CLOSE_CURLY_BRACKET, foo)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -38,7 +38,6 @@
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(foo, expression)
                               listener: handleNoTypeArguments(()
@@ -64,7 +63,7 @@
                                                     inPlainSync()
                                                   parseFunctionBody(), true, false)
                                                     listener: beginBlockFunctionBody({)
-                                                    notEofOrValue(}, bar)
+                                                    notEofOrType(CLOSE_CURLY_BRACKET, bar)
                                                     parseStatement({)
                                                       parseStatementX({)
                                                         parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -77,7 +76,6 @@
                                                                     parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                                                                       looksLikeFunctionBody())
                                                                       parseSend({, expression, ConstantPatternContext.none)
-                                                                        isNextIdentifier({)
                                                                         ensureIdentifier({, expression)
                                                                           listener: handleIdentifier(bar, expression)
                                                                         listener: handleNoTypeArguments(()
@@ -92,7 +90,7 @@
                                                                 listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], ), ))
                                                               rewriter()
                                                             listener: handleExpressionStatement(bar, ;)
-                                                    notEofOrValue(}, ))
+                                                    notEofOrType(CLOSE_CURLY_BRACKET, ))
                                                     parseStatement(;)
                                                       parseStatementX(;)
                                                         parseExpressionStatementOrDeclaration(;, null)
@@ -104,7 +102,6 @@
                                                                   parseUnaryExpression(;, true, ConstantPatternContext.none)
                                                                     parsePrimary(;, expression, ConstantPatternContext.none)
                                                                       parseSend(;, expression, ConstantPatternContext.none)
-                                                                        isNextIdentifier(;)
                                                                         ensureIdentifier(;, expression)
                                                                           reportRecoverableErrorWithToken(), Template(ExpectedIdentifier))
                                                                             listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got ')'., Try inserting an identifier before ')'., {lexeme: )}], ), ))
@@ -121,19 +118,19 @@
                                                               listener: handleExpressionStatement(), ;)
                                                     reportRecoverableError(;, Message[UnexpectedToken, Unexpected token ';'., null, {lexeme: ;}])
                                                       listener: handleRecoverableError(Message[UnexpectedToken, Unexpected token ';'., null, {lexeme: ;}], ), ))
-                                                    notEofOrValue(}, ;)
+                                                    notEofOrType(CLOSE_CURLY_BRACKET, ;)
                                                     parseStatement())
                                                       parseStatementX())
                                                         parseEmptyStatement())
                                                           listener: handleEmptyStatement(;)
-                                                    notEofOrValue(}, })
+                                                    notEofOrType(CLOSE_CURLY_BRACKET, })
                                                     listener: endBlockFunctionBody(3, {, })
                                                 listener: endFunctionExpression((, })
                                     listener: endArguments(1, (, ))
                               listener: handleSend(foo, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(foo, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/bracket_mismatch_05.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/bracket_mismatch_05.dart.intertwined.expect
index 24263a2..cfb3c93 100644
--- a/pkg/front_end/parser_testcases/error_recovery/bracket_mismatch_05.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/bracket_mismatch_05.dart.intertwined.expect
@@ -25,13 +25,13 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, {)
+          notEofOrType(CLOSE_CURLY_BRACKET, {)
           parseStatement({)
             parseStatementX({)
               parseBlock({, BlockKind(statement))
                 ensureBlock({, BlockKind(statement))
                 listener: beginBlock({, BlockKind(statement))
-                notEofOrValue(}, [)
+                notEofOrType(CLOSE_CURLY_BRACKET, [)
                 parseStatement({)
                   parseStatementX({)
                     parseExpressionStatementOrDeclaration({, null)
@@ -56,14 +56,14 @@
                               listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], 1, 1)
                             rewriter()
                           listener: handleExpressionStatement([, ;)
-                notEofOrValue(}, })
+                notEofOrType(CLOSE_CURLY_BRACKET, })
                 listener: endBlock(1, {, }, BlockKind(statement))
-          notEofOrValue(}, ;)
+          notEofOrType(CLOSE_CURLY_BRACKET, ;)
           parseStatement(})
             parseStatementX(})
               parseEmptyStatement(})
                 listener: handleEmptyStatement(;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/bracket_mismatch_06.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/bracket_mismatch_06.dart.intertwined.expect
index c8e93df..f2a4686 100644
--- a/pkg/front_end/parser_testcases/error_recovery/bracket_mismatch_06.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/bracket_mismatch_06.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, new)
+          notEofOrType(CLOSE_CURLY_BRACKET, new)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -38,7 +38,6 @@
                         parseUnaryExpression({, true, ConstantPatternContext.none)
                           parsePrimary({, expression, ConstantPatternContext.none)
                             parseNewExpression({)
-                              isNextIdentifier(new)
                               listener: beginNewExpression(new)
                               parseConstructorReference(new, ConstructorReferenceContext.New, null)
                                 ensureIdentifier(new, constructorReference)
@@ -56,7 +55,6 @@
                                       parseUnaryExpression((, true, ConstantPatternContext.none)
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSend((, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(()
                                             ensureIdentifier((, expression)
                                               reportRecoverableErrorWithToken(;, Template(ExpectedIdentifier))
                                                 listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got ';'., Try inserting an identifier before ';'., {lexeme: ;}], ;, ;)
@@ -72,7 +70,7 @@
                               listener: endNewExpression(new)
                     ensureSemicolon())
                     listener: handleExpressionStatement(new, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/comment_on_non_ascii_identifier.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/comment_on_non_ascii_identifier.dart.intertwined.expect
index e710958..faa57c0 100644
--- a/pkg/front_end/parser_testcases/error_recovery/comment_on_non_ascii_identifier.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/comment_on_non_ascii_identifier.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, int)
+          notEofOrType(CLOSE_CURLY_BRACKET, int)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -54,7 +54,7 @@
                     listener: endInitializedIdentifier(æFoo)
                   ensureSemicolon(42)
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, int)
+          notEofOrType(CLOSE_CURLY_BRACKET, int)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -82,7 +82,7 @@
                     listener: endInitializedIdentifier(fooÆ)
                   ensureSemicolon(42)
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, int)
+          notEofOrType(CLOSE_CURLY_BRACKET, int)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -110,7 +110,7 @@
                     listener: endInitializedIdentifier(foo)
                   ensureSemicolon(42)
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, print)
+          notEofOrType(CLOSE_CURLY_BRACKET, print)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -123,7 +123,6 @@
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(print, expression)
                               listener: handleNoTypeArguments(()
@@ -137,7 +136,6 @@
                                           parsePrimary((, expression, ConstantPatternContext.none)
                                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                               parseSend((, expression, ConstantPatternContext.none)
-                                                isNextIdentifier(()
                                                 ensureIdentifier((, expression)
                                                   listener: handleIdentifier(æFoo, expression)
                                                 listener: handleNoTypeArguments())
@@ -148,7 +146,7 @@
                               listener: handleSend(print, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(print, ;)
-          notEofOrValue(}, print)
+          notEofOrType(CLOSE_CURLY_BRACKET, print)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -161,7 +159,6 @@
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(print, expression)
                               listener: handleNoTypeArguments(()
@@ -175,7 +172,6 @@
                                           parsePrimary((, expression, ConstantPatternContext.none)
                                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                               parseSend((, expression, ConstantPatternContext.none)
-                                                isNextIdentifier(()
                                                 ensureIdentifier((, expression)
                                                   listener: handleIdentifier(fooÆ, expression)
                                                 listener: handleNoTypeArguments())
@@ -186,7 +182,7 @@
                               listener: handleSend(print, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(print, ;)
-          notEofOrValue(}, print)
+          notEofOrType(CLOSE_CURLY_BRACKET, print)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -199,7 +195,6 @@
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(print, expression)
                               listener: handleNoTypeArguments(()
@@ -213,7 +208,6 @@
                                           parsePrimary((, expression, ConstantPatternContext.none)
                                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                               parseSend((, expression, ConstantPatternContext.none)
-                                                isNextIdentifier(()
                                                 ensureIdentifier((, expression)
                                                   listener: handleIdentifier(foo, expression)
                                                 listener: handleNoTypeArguments())
@@ -224,7 +218,7 @@
                               listener: handleSend(print, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(print, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(6, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/constructor_recovery_bad_name_general.crash_dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/constructor_recovery_bad_name_general.crash_dart.intertwined.expect
index 669b2bb..acb5880 100644
--- a/pkg/front_end/parser_testcases/error_recovery/constructor_recovery_bad_name_general.crash_dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/constructor_recovery_bad_name_general.crash_dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Foo, DeclarationKind.Class, Foo)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, foo)
+            notEofOrType(CLOSE_CURLY_BRACKET, foo)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Foo)
               parseMetadataStar({)
                 listener: beginMetadataStar(foo)
@@ -57,13 +57,13 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 reportRecoverableError(foo, ConstructorWithWrongName)
                   listener: handleRecoverableError(ConstructorWithWrongName, foo, foo)
                 listener: endClassConstructor(null, foo, (, null, })
               listener: endMember()
-            notEofOrValue(}, foo)
+            notEofOrType(CLOSE_CURLY_BRACKET, foo)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(foo)
@@ -99,7 +99,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(initializer, expression)
                                     listener: handleNoTypeArguments(=)
@@ -120,13 +119,13 @@
                 inPlainSync()
                 parseFunctionBody(true, false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 reportRecoverableError(foo, ConstructorWithWrongName)
                   listener: handleRecoverableError(ConstructorWithWrongName, foo, foo)
                 listener: endClassConstructor(null, foo, (, :, })
               listener: endMember()
-            notEofOrValue(}, foo)
+            notEofOrType(CLOSE_CURLY_BRACKET, foo)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(foo)
@@ -158,7 +157,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(initializer, expression)
                                     listener: handleNoTypeArguments(=)
@@ -179,13 +177,13 @@
                 inPlainSync()
                 parseFunctionBody(true, false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 reportRecoverableError(foo, ConstructorWithWrongName)
                   listener: handleRecoverableError(ConstructorWithWrongName, foo, foo)
                 listener: endClassConstructor(null, foo, (, :, })
               listener: endMember()
-            notEofOrValue(}, get)
+            notEofOrType(CLOSE_CURLY_BRACKET, get)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(get)
@@ -222,7 +220,7 @@
                   listener: handleRecoverableError(MemberWithSameNameAsClass, Foo, Foo)
                 listener: endClassMethod(get, get, =>, null, ;)
               listener: endMember()
-            notEofOrValue(}, get)
+            notEofOrType(CLOSE_CURLY_BRACKET, get)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(get)
@@ -246,7 +244,7 @@
                 inPlainSync()
                 parseFunctionBody(Foo, false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement({)
                     parseStatementX({)
                       parseReturnStatement({)
@@ -260,13 +258,13 @@
                         ensureSemicolon(0)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 reportRecoverableError(Foo, MemberWithSameNameAsClass)
                   listener: handleRecoverableError(MemberWithSameNameAsClass, Foo, Foo)
                 listener: endClassMethod(get, get, {, null, })
               listener: endMember()
-            notEofOrValue(}, get)
+            notEofOrType(CLOSE_CURLY_BRACKET, get)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(get)
@@ -313,7 +311,7 @@
                   listener: handleRecoverableError(GetterConstructor, get, get)
                 listener: endClassConstructor(get, get, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, get)
+            notEofOrType(CLOSE_CURLY_BRACKET, get)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(get)
@@ -347,7 +345,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement({)
                     parseStatementX({)
                       parseReturnStatement({)
@@ -361,13 +359,13 @@
                         ensureSemicolon(0)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 reportRecoverableError(get, GetterConstructor)
                   listener: handleRecoverableError(GetterConstructor, get, get)
                 listener: endClassConstructor(get, get, (, null, })
               listener: endMember()
-            notEofOrValue(}, get)
+            notEofOrType(CLOSE_CURLY_BRACKET, get)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(get)
@@ -400,7 +398,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(bla, expression)
                                     listener: handleNoTypeArguments(=)
@@ -435,7 +432,7 @@
                   listener: handleRecoverableError(GetterConstructor, get, get)
                 listener: endClassConstructor(get, get, (, :, ;)
               listener: endMember()
-            notEofOrValue(}, get)
+            notEofOrType(CLOSE_CURLY_BRACKET, get)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(get)
@@ -472,7 +469,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(bla, expression)
                                     listener: handleNoTypeArguments(=)
@@ -494,7 +490,7 @@
                 inPlainSync()
                 parseFunctionBody(null, false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement({)
                     parseStatementX({)
                       parseReturnStatement({)
@@ -508,13 +504,13 @@
                         ensureSemicolon(0)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 reportRecoverableError(get, GetterConstructor)
                   listener: handleRecoverableError(GetterConstructor, get, get)
                 listener: endClassConstructor(get, get, (, :, })
               listener: endMember()
-            notEofOrValue(}, set)
+            notEofOrType(CLOSE_CURLY_BRACKET, set)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(set)
@@ -557,7 +553,7 @@
                   listener: handleRecoverableError(MemberWithSameNameAsClass, Foo, Foo)
                 listener: endClassMethod(set, set, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, set)
+            notEofOrType(CLOSE_CURLY_BRACKET, set)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(set)
@@ -587,7 +583,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement({)
                     parseStatementX({)
                       parseReturnStatement({)
@@ -601,13 +597,13 @@
                         ensureSemicolon(0)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 reportRecoverableError(Foo, MemberWithSameNameAsClass)
                   listener: handleRecoverableError(MemberWithSameNameAsClass, Foo, Foo)
                 listener: endClassMethod(set, set, (, null, })
               listener: endMember()
-            notEofOrValue(}, set)
+            notEofOrType(CLOSE_CURLY_BRACKET, set)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(set)
@@ -654,7 +650,7 @@
                   listener: handleRecoverableError(SetterConstructor, set, set)
                 listener: endClassConstructor(set, set, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, set)
+            notEofOrType(CLOSE_CURLY_BRACKET, set)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(set)
@@ -688,7 +684,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement({)
                     parseStatementX({)
                       parseReturnStatement({)
@@ -702,13 +698,13 @@
                         ensureSemicolon(0)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 reportRecoverableError(set, SetterConstructor)
                   listener: handleRecoverableError(SetterConstructor, set, set)
                 listener: endClassConstructor(set, set, (, null, })
               listener: endMember()
-            notEofOrValue(}, set)
+            notEofOrType(CLOSE_CURLY_BRACKET, set)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(set)
@@ -741,7 +737,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(bla, expression)
                                     listener: handleNoTypeArguments(=)
@@ -776,7 +771,7 @@
                   listener: handleRecoverableError(SetterConstructor, set, set)
                 listener: endClassConstructor(set, set, (, :, ;)
               listener: endMember()
-            notEofOrValue(}, set)
+            notEofOrType(CLOSE_CURLY_BRACKET, set)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(set)
@@ -813,7 +808,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(bla, expression)
                                     listener: handleNoTypeArguments(=)
@@ -835,7 +829,7 @@
                 inPlainSync()
                 parseFunctionBody(null, false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement({)
                     parseStatementX({)
                       parseReturnStatement({)
@@ -849,13 +843,13 @@
                         ensureSemicolon(0)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 reportRecoverableError(set, SetterConstructor)
                   listener: handleRecoverableError(SetterConstructor, set, set)
                 listener: endClassConstructor(set, set, (, :, })
               listener: endMember()
-            notEofOrValue(}, external)
+            notEofOrType(CLOSE_CURLY_BRACKET, external)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(external)
@@ -887,7 +881,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(bla, expression)
                                     listener: handleNoTypeArguments(=)
@@ -912,7 +905,7 @@
                   listener: handleRecoverableError(ExternalConstructorWithInitializer, :, :)
                 listener: endClassConstructor(null, external, (, :, ;)
               listener: endMember()
-            notEofOrValue(}, external)
+            notEofOrType(CLOSE_CURLY_BRACKET, external)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(external)
@@ -948,7 +941,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(bla, expression)
                                     listener: handleNoTypeArguments(=)
@@ -971,7 +963,7 @@
                 inPlainSync()
                 parseFunctionBody(null, false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement({)
                     parseStatementX({)
                       parseReturnStatement({)
@@ -985,13 +977,13 @@
                         ensureSemicolon(0)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 reportRecoverableError(:, ExternalConstructorWithInitializer)
                   listener: handleRecoverableError(ExternalConstructorWithInitializer, :, :)
                 listener: endClassConstructor(null, external, (, :, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -1010,7 +1002,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -1037,7 +1029,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, null, null, null, null, 3, int, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 19, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/constructor_recovery_bad_name_get.crash_dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/constructor_recovery_bad_name_get.crash_dart.intertwined.expect
index f797ec4..6ea2579 100644
--- a/pkg/front_end/parser_testcases/error_recovery/constructor_recovery_bad_name_get.crash_dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/constructor_recovery_bad_name_get.crash_dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Foo, DeclarationKind.Class, Foo)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, get)
+            notEofOrType(CLOSE_CURLY_BRACKET, get)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Foo)
               parseMetadataStar({)
                 listener: beginMetadataStar(get)
@@ -56,7 +56,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 reportRecoverableError(foo, ConstructorWithWrongName)
                   listener: handleRecoverableError(ConstructorWithWrongName, foo, foo)
@@ -64,7 +64,7 @@
                   listener: handleRecoverableError(GetterConstructor, get, get)
                 listener: endClassConstructor(get, get, (, null, })
               listener: endMember()
-            notEofOrValue(}, get)
+            notEofOrType(CLOSE_CURLY_BRACKET, get)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(get)
@@ -98,7 +98,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(initializer, expression)
                                     listener: handleNoTypeArguments(=)
@@ -120,7 +119,7 @@
                 inPlainSync()
                 parseFunctionBody(true, false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 reportRecoverableError(foo, ConstructorWithWrongName)
                   listener: handleRecoverableError(ConstructorWithWrongName, foo, foo)
@@ -128,7 +127,7 @@
                   listener: handleRecoverableError(GetterConstructor, get, get)
                 listener: endClassConstructor(get, get, (, :, })
               listener: endMember()
-            notEofOrValue(}, get)
+            notEofOrType(CLOSE_CURLY_BRACKET, get)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(get)
@@ -160,7 +159,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(initializer, expression)
                                     listener: handleNoTypeArguments(=)
@@ -182,7 +180,7 @@
                 inPlainSync()
                 parseFunctionBody(true, false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 reportRecoverableError(foo, ConstructorWithWrongName)
                   listener: handleRecoverableError(ConstructorWithWrongName, foo, foo)
@@ -190,7 +188,7 @@
                   listener: handleRecoverableError(GetterConstructor, get, get)
                 listener: endClassConstructor(get, get, (, :, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 3, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/constructor_recovery_bad_name_return_type.crash_dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/constructor_recovery_bad_name_return_type.crash_dart.intertwined.expect
index c171219..9d729ae 100644
--- a/pkg/front_end/parser_testcases/error_recovery/constructor_recovery_bad_name_return_type.crash_dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/constructor_recovery_bad_name_return_type.crash_dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Foo, DeclarationKind.Class, Foo)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Foo)
               parseMetadataStar({)
                 listener: beginMetadataStar(void)
@@ -56,7 +56,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 reportRecoverableError(foo, ConstructorWithWrongName)
                   listener: handleRecoverableError(ConstructorWithWrongName, foo, foo)
@@ -64,7 +64,7 @@
                   listener: handleRecoverableError(ConstructorWithReturnType, void, void)
                 listener: endClassConstructor(null, void, (, null, })
               listener: endMember()
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(void)
@@ -99,7 +99,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(initializer, expression)
                                     listener: handleNoTypeArguments(=)
@@ -120,7 +119,7 @@
                 inPlainSync()
                 parseFunctionBody(true, false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 reportRecoverableError(foo, ConstructorWithWrongName)
                   listener: handleRecoverableError(ConstructorWithWrongName, foo, foo)
@@ -128,7 +127,7 @@
                   listener: handleRecoverableError(ConstructorWithReturnType, void, void)
                 listener: endClassConstructor(null, void, (, :, })
               listener: endMember()
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(void)
@@ -159,7 +158,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(initializer, expression)
                                     listener: handleNoTypeArguments(=)
@@ -180,7 +178,7 @@
                 inPlainSync()
                 parseFunctionBody(true, false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 reportRecoverableError(foo, ConstructorWithWrongName)
                   listener: handleRecoverableError(ConstructorWithWrongName, foo, foo)
@@ -188,7 +186,7 @@
                   listener: handleRecoverableError(ConstructorWithReturnType, void, void)
                 listener: endClassConstructor(null, void, (, :, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 3, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/constructor_recovery_bad_name_set.crash_dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/constructor_recovery_bad_name_set.crash_dart.intertwined.expect
index 62c0e31..aa4e7a0 100644
--- a/pkg/front_end/parser_testcases/error_recovery/constructor_recovery_bad_name_set.crash_dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/constructor_recovery_bad_name_set.crash_dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Foo, DeclarationKind.Class, Foo)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, set)
+            notEofOrType(CLOSE_CURLY_BRACKET, set)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Foo)
               parseMetadataStar({)
                 listener: beginMetadataStar(set)
@@ -56,7 +56,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 reportRecoverableError(foo, ConstructorWithWrongName)
                   listener: handleRecoverableError(ConstructorWithWrongName, foo, foo)
@@ -64,7 +64,7 @@
                   listener: handleRecoverableError(SetterConstructor, set, set)
                 listener: endClassConstructor(set, set, (, null, })
               listener: endMember()
-            notEofOrValue(}, set)
+            notEofOrType(CLOSE_CURLY_BRACKET, set)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(set)
@@ -98,7 +98,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(initializer, expression)
                                     listener: handleNoTypeArguments(=)
@@ -120,7 +119,7 @@
                 inPlainSync()
                 parseFunctionBody(true, false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 reportRecoverableError(foo, ConstructorWithWrongName)
                   listener: handleRecoverableError(ConstructorWithWrongName, foo, foo)
@@ -128,7 +127,7 @@
                   listener: handleRecoverableError(SetterConstructor, set, set)
                 listener: endClassConstructor(set, set, (, :, })
               listener: endMember()
-            notEofOrValue(}, set)
+            notEofOrType(CLOSE_CURLY_BRACKET, set)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(set)
@@ -158,7 +157,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(initializer, expression)
                                     listener: handleNoTypeArguments(=)
@@ -180,7 +178,7 @@
                 inPlainSync()
                 parseFunctionBody(true, false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 reportRecoverableError(foo, ConstructorWithWrongName)
                   listener: handleRecoverableError(ConstructorWithWrongName, foo, foo)
@@ -188,7 +186,7 @@
                   listener: handleRecoverableError(SetterConstructor, set, set)
                 listener: endClassConstructor(set, set, (, :, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 3, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/constructor_recovery_get.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/constructor_recovery_get.dart.intertwined.expect
index f54ea12..cba5068 100644
--- a/pkg/front_end/parser_testcases/error_recovery/constructor_recovery_get.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/constructor_recovery_get.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Foo, DeclarationKind.Class, Foo)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, get)
+            notEofOrType(CLOSE_CURLY_BRACKET, get)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Foo)
               parseMetadataStar({)
                 listener: beginMetadataStar(get)
@@ -54,13 +54,13 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 reportRecoverableError(Foo, MemberWithSameNameAsClass)
                   listener: handleRecoverableError(MemberWithSameNameAsClass, Foo, Foo)
                 listener: endClassMethod(get, get, (, null, })
               listener: endMember()
-            notEofOrValue(}, get)
+            notEofOrType(CLOSE_CURLY_BRACKET, get)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(get)
@@ -92,7 +92,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(initializer, expression)
                                     listener: handleNoTypeArguments(=)
@@ -114,13 +113,13 @@
                 inPlainSync()
                 parseFunctionBody(true, false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 reportRecoverableError(get, GetterConstructor)
                   listener: handleRecoverableError(GetterConstructor, get, get)
                 listener: endClassConstructor(get, get, (, :, })
               listener: endMember()
-            notEofOrValue(}, get)
+            notEofOrType(CLOSE_CURLY_BRACKET, get)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(get)
@@ -151,13 +150,13 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 reportRecoverableError(get, GetterConstructor)
                   listener: handleRecoverableError(GetterConstructor, get, get)
                 listener: endClassConstructor(get, get, (, null, })
               listener: endMember()
-            notEofOrValue(}, get)
+            notEofOrType(CLOSE_CURLY_BRACKET, get)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(get)
@@ -191,7 +190,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(initializer, expression)
                                     listener: handleNoTypeArguments(=)
@@ -213,13 +211,13 @@
                 inPlainSync()
                 parseFunctionBody(true, false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 reportRecoverableError(get, GetterConstructor)
                   listener: handleRecoverableError(GetterConstructor, get, get)
                 listener: endClassConstructor(get, get, (, :, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 4, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/constructor_recovery_ok.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/constructor_recovery_ok.dart.intertwined.expect
index 52e2fe3..74bf2d0 100644
--- a/pkg/front_end/parser_testcases/error_recovery/constructor_recovery_ok.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/constructor_recovery_ok.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Foo, DeclarationKind.Class, Foo)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, Foo)
+            notEofOrType(CLOSE_CURLY_BRACKET, Foo)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Foo)
               parseMetadataStar({)
                 listener: beginMetadataStar(Foo)
@@ -53,11 +53,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassConstructor(null, Foo, (, null, })
               listener: endMember()
-            notEofOrValue(}, Foo)
+            notEofOrType(CLOSE_CURLY_BRACKET, Foo)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(Foo)
@@ -89,7 +89,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(initializer, expression)
                                     listener: handleNoTypeArguments(=)
@@ -110,11 +109,11 @@
                 inPlainSync()
                 parseFunctionBody(true, false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassConstructor(null, Foo, (, :, })
               listener: endMember()
-            notEofOrValue(}, Foo)
+            notEofOrType(CLOSE_CURLY_BRACKET, Foo)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(Foo)
@@ -146,11 +145,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassConstructor(null, Foo, (, null, })
               listener: endMember()
-            notEofOrValue(}, Foo)
+            notEofOrType(CLOSE_CURLY_BRACKET, Foo)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(Foo)
@@ -186,7 +185,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(initializer, expression)
                                     listener: handleNoTypeArguments(=)
@@ -207,11 +205,11 @@
                 inPlainSync()
                 parseFunctionBody(true, false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassConstructor(null, Foo, (, :, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 4, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/constructor_recovery_operator.crash_dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/constructor_recovery_operator.crash_dart.intertwined.expect
index 9ba7150..aaa252b 100644
--- a/pkg/front_end/parser_testcases/error_recovery/constructor_recovery_operator.crash_dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/constructor_recovery_operator.crash_dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Foo, DeclarationKind.Class, Foo)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, Foo)
+            notEofOrType(CLOSE_CURLY_BRACKET, Foo)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Foo)
               parseMetadataStar({)
                 listener: beginMetadataStar(Foo)
@@ -61,7 +61,7 @@
                   listener: handleInvalidFunctionBody({)
                 listener: endClassConstructor(null, Foo, (, null, })
               listener: endMember()
-            notEofOrValue(}, /)
+            notEofOrType(CLOSE_CURLY_BRACKET, /)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(/)
@@ -114,13 +114,13 @@
                     inPlainSync()
                     parseFunctionBody(), false, true)
                       listener: beginBlockFunctionBody({)
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlockFunctionBody(0, {, })
                     reportRecoverableError(operator, ConstructorWithWrongName)
                       listener: handleRecoverableError(ConstructorWithWrongName, /, /)
                     listener: endClassConstructor(null, operator, (, :, })
                   listener: endMember()
-            notEofOrValue(}, Foo)
+            notEofOrType(CLOSE_CURLY_BRACKET, Foo)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(Foo)
@@ -156,7 +156,7 @@
                   listener: handleInvalidFunctionBody({)
                 listener: endClassConstructor(null, Foo, (, null, })
               listener: endMember()
-            notEofOrValue(}, .)
+            notEofOrType(CLOSE_CURLY_BRACKET, .)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(.)
@@ -167,7 +167,7 @@
                   listener: handleRecoverableError(Message[ExpectedClassMember, Expected a class member, but got '.'., null, {lexeme: .}], ., .)
                 listener: handleInvalidMember(.)
                 listener: endMember()
-            notEofOrValue(}, /)
+            notEofOrType(CLOSE_CURLY_BRACKET, /)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(., DeclarationKind.Class, Foo)
               parseMetadataStar(.)
                 listener: beginMetadataStar(/)
@@ -220,13 +220,13 @@
                     inPlainSync()
                     parseFunctionBody(), false, true)
                       listener: beginBlockFunctionBody({)
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlockFunctionBody(0, {, })
                     reportRecoverableError(operator, ConstructorWithWrongName)
                       listener: handleRecoverableError(ConstructorWithWrongName, /, /)
                     listener: endClassConstructor(null, operator, (, :, })
                   listener: endMember()
-            notEofOrValue(}, foo)
+            notEofOrType(CLOSE_CURLY_BRACKET, foo)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(foo)
@@ -262,7 +262,7 @@
                   listener: handleInvalidFunctionBody({)
                 listener: endClassMethod(null, foo, (, null, })
               listener: endMember()
-            notEofOrValue(}, /)
+            notEofOrType(CLOSE_CURLY_BRACKET, /)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(/)
@@ -315,13 +315,13 @@
                     inPlainSync()
                     parseFunctionBody(), false, true)
                       listener: beginBlockFunctionBody({)
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlockFunctionBody(0, {, })
                     reportRecoverableError(operator, ConstructorWithWrongName)
                       listener: handleRecoverableError(ConstructorWithWrongName, /, /)
                     listener: endClassConstructor(null, operator, (, :, })
                   listener: endMember()
-            notEofOrValue(}, foo)
+            notEofOrType(CLOSE_CURLY_BRACKET, foo)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(foo)
@@ -357,7 +357,7 @@
                   listener: handleInvalidFunctionBody({)
                 listener: endClassMethod(null, foo, (, null, })
               listener: endMember()
-            notEofOrValue(}, .)
+            notEofOrType(CLOSE_CURLY_BRACKET, .)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(.)
@@ -368,7 +368,7 @@
                   listener: handleRecoverableError(Message[ExpectedClassMember, Expected a class member, but got '.'., null, {lexeme: .}], ., .)
                 listener: handleInvalidMember(.)
                 listener: endMember()
-            notEofOrValue(}, /)
+            notEofOrType(CLOSE_CURLY_BRACKET, /)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(., DeclarationKind.Class, Foo)
               parseMetadataStar(.)
                 listener: beginMetadataStar(/)
@@ -421,13 +421,13 @@
                     inPlainSync()
                     parseFunctionBody(), false, true)
                       listener: beginBlockFunctionBody({)
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlockFunctionBody(0, {, })
                     reportRecoverableError(operator, ConstructorWithWrongName)
                       listener: handleRecoverableError(ConstructorWithWrongName, /, /)
                     listener: endClassConstructor(null, operator, (, :, })
                   listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 10, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/constructor_recovery_return_type.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/constructor_recovery_return_type.dart.intertwined.expect
index 746f9f4..98a1ff7 100644
--- a/pkg/front_end/parser_testcases/error_recovery/constructor_recovery_return_type.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/constructor_recovery_return_type.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Foo, DeclarationKind.Class, Foo)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Foo)
               parseMetadataStar({)
                 listener: beginMetadataStar(void)
@@ -52,13 +52,13 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 reportRecoverableError(void, ConstructorWithReturnType)
                   listener: handleRecoverableError(ConstructorWithReturnType, void, void)
                 listener: endClassConstructor(null, void, (, null, })
               listener: endMember()
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(void)
@@ -89,7 +89,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(initializer, expression)
                                     listener: handleNoTypeArguments(=)
@@ -110,13 +109,13 @@
                 inPlainSync()
                 parseFunctionBody(true, false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 reportRecoverableError(void, ConstructorWithReturnType)
                   listener: handleRecoverableError(ConstructorWithReturnType, void, void)
                 listener: endClassConstructor(null, void, (, :, })
               listener: endMember()
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(void)
@@ -147,13 +146,13 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 reportRecoverableError(void, ConstructorWithReturnType)
                   listener: handleRecoverableError(ConstructorWithReturnType, void, void)
                 listener: endClassConstructor(null, void, (, null, })
               listener: endMember()
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(void)
@@ -188,7 +187,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(initializer, expression)
                                     listener: handleNoTypeArguments(=)
@@ -209,13 +207,13 @@
                 inPlainSync()
                 parseFunctionBody(true, false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 reportRecoverableError(void, ConstructorWithReturnType)
                   listener: handleRecoverableError(ConstructorWithReturnType, void, void)
                 listener: endClassConstructor(null, void, (, :, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 4, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/constructor_recovery_set.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/constructor_recovery_set.dart.intertwined.expect
index 78d6518..b6ac85a 100644
--- a/pkg/front_end/parser_testcases/error_recovery/constructor_recovery_set.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/constructor_recovery_set.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Foo, DeclarationKind.Class, Foo)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, set)
+            notEofOrType(CLOSE_CURLY_BRACKET, set)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Foo)
               parseMetadataStar({)
                 listener: beginMetadataStar(set)
@@ -52,13 +52,13 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 reportRecoverableError(Foo, MemberWithSameNameAsClass)
                   listener: handleRecoverableError(MemberWithSameNameAsClass, Foo, Foo)
                 listener: endClassMethod(set, set, (, null, })
               listener: endMember()
-            notEofOrValue(}, set)
+            notEofOrType(CLOSE_CURLY_BRACKET, set)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(set)
@@ -88,7 +88,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(initializer, expression)
                                     listener: handleNoTypeArguments(=)
@@ -110,13 +109,13 @@
                 inPlainSync()
                 parseFunctionBody(true, false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 reportRecoverableError(set, SetterConstructor)
                   listener: handleRecoverableError(SetterConstructor, set, set)
                 listener: endClassConstructor(set, set, (, :, })
               listener: endMember()
-            notEofOrValue(}, set)
+            notEofOrType(CLOSE_CURLY_BRACKET, set)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(set)
@@ -147,13 +146,13 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 reportRecoverableError(set, SetterConstructor)
                   listener: handleRecoverableError(SetterConstructor, set, set)
                 listener: endClassConstructor(set, set, (, null, })
               listener: endMember()
-            notEofOrValue(}, set)
+            notEofOrType(CLOSE_CURLY_BRACKET, set)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(set)
@@ -187,7 +186,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(initializer, expression)
                                     listener: handleNoTypeArguments(=)
@@ -209,13 +207,13 @@
                 inPlainSync()
                 parseFunctionBody(true, false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 reportRecoverableError(set, SetterConstructor)
                   listener: handleRecoverableError(SetterConstructor, set, set)
                 listener: endClassConstructor(set, set, (, :, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 4, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/empty_await_for.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/empty_await_for.dart.intertwined.expect
index f2a53db..2ba473a 100644
--- a/pkg/front_end/parser_testcases/error_recovery/empty_await_for.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/empty_await_for.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(async, false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, await)
+          notEofOrType(CLOSE_CURLY_BRACKET, await)
           parseStatement({)
             parseStatementX({)
               parseForStatement(await, await)
@@ -40,7 +40,6 @@
                       parseUnaryExpression((, true, ConstantPatternContext.none)
                         parsePrimary((, expression, ConstantPatternContext.none)
                           parseSend((, expression, ConstantPatternContext.none)
-                            isNextIdentifier(()
                             ensureIdentifier((, expression)
                               reportRecoverableErrorWithToken(), Template(ExpectedIdentifier))
                                 listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got ')'., Try inserting an identifier before ')'., {lexeme: )}], ), ))
@@ -64,7 +63,6 @@
                         parseUnaryExpression(in, true, ConstantPatternContext.none)
                           parsePrimary(in, expression, ConstantPatternContext.none)
                             parseSend(in, expression, ConstantPatternContext.none)
-                              isNextIdentifier(in)
                               ensureIdentifier(in, expression)
                                 reportRecoverableErrorWithToken(), Template(ExpectedIdentifier))
                                   listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got ')'., Try inserting an identifier before ')'., {lexeme: )}], ), ))
@@ -83,11 +81,11 @@
                       parseBlock(), BlockKind(statement))
                         ensureBlock(), BlockKind(statement))
                         listener: beginBlock({, BlockKind(statement))
-                        notEofOrValue(}, })
+                        notEofOrType(CLOSE_CURLY_BRACKET, })
                         listener: endBlock(0, {, }, BlockKind(statement))
                   listener: endForInBody(})
                   listener: endForIn(})
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/empty_for.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/empty_for.dart.intertwined.expect
index d2e1dcc..e521da3 100644
--- a/pkg/front_end/parser_testcases/error_recovery/empty_for.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/empty_for.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, for)
+          notEofOrType(CLOSE_CURLY_BRACKET, for)
           parseStatement({)
             parseStatementX({)
               parseForStatement({, null)
@@ -40,7 +40,6 @@
                       parseUnaryExpression((, true, ConstantPatternContext.none)
                         parsePrimary((, expression, ConstantPatternContext.none)
                           parseSend((, expression, ConstantPatternContext.none)
-                            isNextIdentifier(()
                             ensureIdentifier((, expression)
                               reportRecoverableErrorWithToken(), Template(ExpectedIdentifier))
                                 listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got ')'., Try inserting an identifier before ')'., {lexeme: )}], ), ))
@@ -63,7 +62,6 @@
                           parseUnaryExpression(;, true, ConstantPatternContext.none)
                             parsePrimary(;, expression, ConstantPatternContext.none)
                               parseSend(;, expression, ConstantPatternContext.none)
-                                isNextIdentifier(;)
                                 ensureIdentifier(;, expression)
                                   reportRecoverableErrorWithToken(), Template(ExpectedIdentifier))
                                     listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got ')'., Try inserting an identifier before ')'., {lexeme: )}], ), ))
@@ -85,11 +83,11 @@
                       parseBlock(), BlockKind(statement))
                         ensureBlock(), BlockKind(statement))
                         listener: beginBlock({, BlockKind(statement))
-                        notEofOrValue(}, })
+                        notEofOrType(CLOSE_CURLY_BRACKET, })
                         listener: endBlock(0, {, }, BlockKind(statement))
                   listener: endForStatementBody(})
                   listener: endForStatement(})
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
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
index 01ea3ed..1ffab18 100644
--- 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
@@ -33,7 +33,7 @@
           listener: handleType(List, null)
           parseClassOrMixinOrExtensionBody(>, DeclarationKind.Extension, E)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Extension, {)
-            notEofOrValue(}, bool)
+            notEofOrType(CLOSE_CURLY_BRACKET, bool)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Extension, E)
               parseMetadataStar({)
                 listener: beginMetadataStar(bool)
@@ -86,11 +86,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endExtensionMethod(null, bool, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Extension, E)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -127,7 +127,7 @@
                     inGenerator()
                 listener: endExtensionMethod(get, int, =>, null, ;)
               listener: endMember()
-            notEofOrValue(}, set)
+            notEofOrType(CLOSE_CURLY_BRACKET, set)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Extension, E)
               parseMetadataStar(;)
                 listener: beginMetadataStar(set)
@@ -166,11 +166,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endExtensionMethod(set, set, (, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Extension, 3, {, })
           listener: endExtensionDeclaration(extension, extension, on, })
   listener: endTopLevelDeclaration(})
@@ -213,7 +213,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, l)
+          notEofOrType(CLOSE_CURLY_BRACKET, l)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -225,7 +225,6 @@
                         parsePrimary({, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(l, expression)
                               listener: handleNoTypeArguments(.)
@@ -235,7 +234,6 @@
                       parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                         parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                           parseSend(., expressionContinuation, ConstantPatternContext.none)
-                            isNextIdentifier(.)
                             ensureIdentifier(., expressionContinuation)
                               listener: handleIdentifier(a, expressionContinuation)
                             listener: handleNoTypeArguments(})
@@ -248,7 +246,7 @@
                       listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], a, a)
                     rewriter()
                   listener: handleExpressionStatement(l, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -291,7 +289,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, l)
+          notEofOrType(CLOSE_CURLY_BRACKET, l)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -317,7 +315,7 @@
                       listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], print, print)
                     rewriter()
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -337,7 +335,6 @@
                                       parsePrimary((, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                           parseSend((, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(()
                                             ensureIdentifier((, expression)
                                               listener: handleIdentifier(l, expression)
                                             listener: handleNoTypeArguments(.)
@@ -347,7 +344,6 @@
                                     parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                         parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                          isNextIdentifier(.)
                                           ensureIdentifier(., expressionContinuation)
                                             listener: handleIdentifier(b, expressionContinuation)
                                           listener: handleNoTypeArguments())
@@ -359,7 +355,7 @@
                                 listener: endParenthesizedExpression(()
                     ensureSemicolon())
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/for_in_with_colon.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/for_in_with_colon.dart.intertwined.expect
index bc1aa3b..afa17b5 100644
--- a/pkg/front_end/parser_testcases/error_recovery/for_in_with_colon.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/for_in_with_colon.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, for)
+          notEofOrType(CLOSE_CURLY_BRACKET, for)
           parseStatement({)
             parseStatementX({)
               parseForStatement({, null)
@@ -90,7 +90,7 @@
                       parseBlock(), BlockKind(statement))
                         ensureBlock(), BlockKind(statement))
                         listener: beginBlock({, BlockKind(statement))
-                        notEofOrValue(}, print)
+                        notEofOrType(CLOSE_CURLY_BRACKET, print)
                         parseStatement({)
                           parseStatementX({)
                             parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -103,7 +103,6 @@
                                         parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                                           looksLikeFunctionBody(;)
                                           parseSend({, expression, ConstantPatternContext.none)
-                                            isNextIdentifier({)
                                             ensureIdentifier({, expression)
                                               listener: handleIdentifier(print, expression)
                                             listener: handleNoTypeArguments(()
@@ -117,7 +116,6 @@
                                                         parsePrimary((, expression, ConstantPatternContext.none)
                                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                             parseSend((, expression, ConstantPatternContext.none)
-                                                              isNextIdentifier(()
                                                               ensureIdentifier((, expression)
                                                                 listener: handleIdentifier(i, expression)
                                                               listener: handleNoTypeArguments())
@@ -128,11 +126,11 @@
                                             listener: handleSend(print, ))
                                 ensureSemicolon())
                                 listener: handleExpressionStatement(print, ;)
-                        notEofOrValue(}, })
+                        notEofOrType(CLOSE_CURLY_BRACKET, })
                         listener: endBlock(1, {, }, BlockKind(statement))
                   listener: endForInBody(})
                   listener: endForIn(})
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
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
index f6c1d1f..11f1195 100644
--- 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
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(C, DeclarationKind.Class, C)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, C)
+            notEofOrType(CLOSE_CURLY_BRACKET, C)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, C)
               parseMetadataStar({)
                 listener: beginMetadataStar(C)
@@ -59,7 +59,7 @@
                     rewriter()
                   listener: endClassFields(null, null, null, null, null, null, null, 1, C, ;)
                 listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -87,7 +87,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, C)
+          notEofOrType(CLOSE_CURLY_BRACKET, C)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -99,7 +99,6 @@
                         parsePrimary({, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(C, expression)
                               listener: handleNoTypeArguments(<)
@@ -111,7 +110,6 @@
                         parseUnaryExpression(<, true, ConstantPatternContext.none)
                           parsePrimary(<, expression, ConstantPatternContext.none)
                             parseSend(<, expression, ConstantPatternContext.none)
-                              isNextIdentifier(<)
                               ensureIdentifier(<, expression)
                                 reportRecoverableErrorWithToken(}, Template(ExpectedIdentifier))
                                   listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got '}'., Try inserting an identifier before '}'., {lexeme: }}], }, })
@@ -127,7 +125,7 @@
                       listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], <, <)
                     rewriter()
                   listener: handleExpressionStatement(C, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_22313.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_22313.dart.intertwined.expect
index 2fed51e..03ee061 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_22313.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_22313.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(A, DeclarationKind.Class, A)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -52,7 +52,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(B, DeclarationKind.Class, B)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -87,7 +87,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(B, DeclarationKind.Class, Foo)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, Foo)
+            notEofOrType(CLOSE_CURLY_BRACKET, Foo)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Foo)
               parseMetadataStar({)
                 listener: beginMetadataStar(Foo)
@@ -115,11 +115,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassConstructor(null, Foo, (, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -171,7 +171,7 @@
           ensureBlock(B, BlockKind(class declaration))
           parseClassOrMixinOrExtensionBody(B, DeclarationKind.Class, Bar)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, Bar)
+            notEofOrType(CLOSE_CURLY_BRACKET, Bar)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Bar)
               parseMetadataStar({)
                 listener: beginMetadataStar(Bar)
@@ -199,11 +199,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassConstructor(null, Bar, (, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -255,7 +255,7 @@
           ensureBlock(B, BlockKind(class declaration))
           parseClassOrMixinOrExtensionBody(B, DeclarationKind.Class, Baz)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, Baz)
+            notEofOrType(CLOSE_CURLY_BRACKET, Baz)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Baz)
               parseMetadataStar({)
                 listener: beginMetadataStar(Baz)
@@ -283,11 +283,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassConstructor(null, Baz, (, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_22314.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_22314.dart.intertwined.expect
index 276321e..ac0bbb4 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_22314.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_22314.dart.intertwined.expect
@@ -49,7 +49,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Annotation, DeclarationKind.Class, Annotation)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Annotation)
               parseMetadataStar({)
                 listener: beginMetadataStar(final)
@@ -68,7 +68,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, const)
+            notEofOrType(CLOSE_CURLY_BRACKET, const)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Annotation)
               parseMetadataStar(;)
                 listener: beginMetadataStar(const)
@@ -109,7 +109,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, const, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 2, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -144,7 +144,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(>, DeclarationKind.Class, A)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -171,7 +171,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(C, DeclarationKind.Class, C)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, m)
+            notEofOrType(CLOSE_CURLY_BRACKET, m)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, C)
               parseMetadataStar({)
                 listener: beginMetadataStar(m)
@@ -204,7 +204,6 @@
                         parseUnaryExpression(=>, true, ConstantPatternContext.none)
                           parsePrimary(=>, expression, ConstantPatternContext.none)
                             parseNewExpression(=>)
-                              isNextIdentifier(new)
                               listener: beginNewExpression(new)
                               parseConstructorReference(new, ConstructorReferenceContext.New, null)
                                 ensureIdentifier(new, constructorReference)
@@ -232,7 +231,7 @@
                     inGenerator()
                 listener: endClassMethod(null, m, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_26810.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_26810.dart.intertwined.expect
index e82077f..45c5103 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_26810.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_26810.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(abstract, class, null)
           parseClassOrMixinOrExtensionBody(Key, DeclarationKind.Class, Key)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Key)
               parseMetadataStar({)
                 listener: beginMetadataStar(int)
@@ -57,7 +57,6 @@
                           parsePrimary(=>, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(=>, expression, ConstantPatternContext.none)
                               parseSend(=>, expression, ConstantPatternContext.none)
-                                isNextIdentifier(=>)
                                 ensureIdentifier(=>, expression)
                                   listener: handleIdentifier(runtimeType, expression)
                                 listener: handleNoTypeArguments(.)
@@ -67,7 +66,6 @@
                         parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                             parseSend(., expressionContinuation, ConstantPatternContext.none)
-                              isNextIdentifier(.)
                               ensureIdentifier(., expressionContinuation)
                                 listener: handleIdentifier(hashCode, expressionContinuation)
                               listener: handleNoTypeArguments(xor)
@@ -83,7 +81,6 @@
                           parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                               parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                isNextIdentifier(.)
                                 ensureIdentifier(., expressionContinuation)
                                 parseArgumentsOpt(hashCode)
                         reportRecoverableError(xor, Message[BinaryOperatorWrittenOut, Binary operator 'xor' is written as '^' instead of the written out word., Try replacing 'xor' with '^'., {string: xor, string2: ^}])
@@ -98,7 +95,6 @@
                           parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                               parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                isNextIdentifier(.)
                                 ensureIdentifier(., expressionContinuation)
                                   listener: handleIdentifier(hashCode, expressionContinuation)
                                 listener: handleNoTypeArguments(;)
@@ -112,7 +108,7 @@
                     inGenerator()
                 listener: endClassMethod(get, int, =>, null, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Key)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -144,7 +140,6 @@
                           parsePrimary(=>, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(=>, expression, ConstantPatternContext.none)
                               parseSend(=>, expression, ConstantPatternContext.none)
-                                isNextIdentifier(=>)
                                 ensureIdentifier(=>, expression)
                                   listener: handleIdentifier(runtimeType, expression)
                                 listener: handleNoTypeArguments(.)
@@ -154,7 +149,6 @@
                         parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                             parseSend(., expressionContinuation, ConstantPatternContext.none)
-                              isNextIdentifier(.)
                               ensureIdentifier(., expressionContinuation)
                                 listener: handleIdentifier(hashCode, expressionContinuation)
                               listener: handleNoTypeArguments(^)
@@ -171,7 +165,6 @@
                           parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                               parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                isNextIdentifier(.)
                                 ensureIdentifier(., expressionContinuation)
                                   listener: handleIdentifier(hashCode, expressionContinuation)
                                 listener: handleNoTypeArguments(;)
@@ -185,7 +178,7 @@
                     inGenerator()
                 listener: endClassMethod(get, int, =>, null, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Key)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -211,7 +204,7 @@
                 inPlainSync()
                 parseFunctionBody(c, false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement({)
                     parseStatementX({)
                       parseReturnStatement({)
@@ -222,7 +215,6 @@
                               parsePrimary(return, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       listener: handleIdentifier(runtimeType, expression)
                                     listener: handleNoTypeArguments(.)
@@ -232,7 +224,6 @@
                             parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                 parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                  isNextIdentifier(.)
                                   ensureIdentifier(., expressionContinuation)
                                     listener: handleIdentifier(hashCode, expressionContinuation)
                                   listener: handleNoTypeArguments(xor)
@@ -248,7 +239,6 @@
                               parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                   parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                    isNextIdentifier(.)
                                     ensureIdentifier(., expressionContinuation)
                                     parseArgumentsOpt(hashCode)
                             reportRecoverableError(xor, Message[BinaryOperatorWrittenOut, Binary operator 'xor' is written as '^' instead of the written out word., Try replacing 'xor' with '^'., {string: xor, string2: ^}])
@@ -263,7 +253,6 @@
                               parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                   parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                    isNextIdentifier(.)
                                     ensureIdentifier(., expressionContinuation)
                                       listener: handleIdentifier(hashCode, expressionContinuation)
                                     listener: handleNoTypeArguments(;)
@@ -275,11 +264,11 @@
                         ensureSemicolon(hashCode)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(get, int, {, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Key)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -305,7 +294,7 @@
                 inPlainSync()
                 parseFunctionBody(d, false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement({)
                     parseStatementX({)
                       parseReturnStatement({)
@@ -316,7 +305,6 @@
                               parsePrimary(return, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       listener: handleIdentifier(runtimeType, expression)
                                     listener: handleNoTypeArguments(.)
@@ -326,7 +314,6 @@
                             parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                 parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                  isNextIdentifier(.)
                                   ensureIdentifier(., expressionContinuation)
                                     listener: handleIdentifier(hashCode, expressionContinuation)
                                   listener: handleNoTypeArguments(^)
@@ -343,7 +330,6 @@
                               parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                   parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                    isNextIdentifier(.)
                                     ensureIdentifier(., expressionContinuation)
                                       listener: handleIdentifier(hashCode, expressionContinuation)
                                     listener: handleNoTypeArguments(;)
@@ -355,11 +341,11 @@
                         ensureSemicolon(hashCode)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(get, int, {, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Key)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -397,7 +383,6 @@
                             parsePrimary(+, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(+, expression, ConstantPatternContext.none)
                                 parseSend(+, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(+)
                                   ensureIdentifier(+, expression)
                                     listener: handleIdentifier(runtimeType, expression)
                                   listener: handleNoTypeArguments(.)
@@ -407,7 +392,6 @@
                           parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                               parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                isNextIdentifier(.)
                                 ensureIdentifier(., expressionContinuation)
                                   listener: handleIdentifier(hashCode, expressionContinuation)
                                 listener: handleNoTypeArguments(xor)
@@ -425,7 +409,6 @@
                           parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                               parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                isNextIdentifier(.)
                                 ensureIdentifier(., expressionContinuation)
                                 parseArgumentsOpt(hashCode)
                           parsePrecedenceExpression(+, 14, true, ConstantPatternContext.none)
@@ -444,7 +427,6 @@
                           parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                               parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                isNextIdentifier(.)
                                 ensureIdentifier(., expressionContinuation)
                                   listener: handleIdentifier(hashCode, expressionContinuation)
                                 listener: handleNoTypeArguments(+)
@@ -465,7 +447,7 @@
                     inGenerator()
                 listener: endClassMethod(get, int, =>, null, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Key)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -503,7 +485,6 @@
                             parsePrimary(+, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(+, expression, ConstantPatternContext.none)
                                 parseSend(+, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(+)
                                   ensureIdentifier(+, expression)
                                     listener: handleIdentifier(runtimeType, expression)
                                   listener: handleNoTypeArguments(.)
@@ -513,7 +494,6 @@
                           parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                               parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                isNextIdentifier(.)
                                 ensureIdentifier(., expressionContinuation)
                                   listener: handleIdentifier(hashCode, expressionContinuation)
                                 listener: handleNoTypeArguments(^)
@@ -531,7 +511,6 @@
                           parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                               parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                isNextIdentifier(.)
                                 ensureIdentifier(., expressionContinuation)
                                   listener: handleIdentifier(hashCode, expressionContinuation)
                                 listener: handleNoTypeArguments(+)
@@ -552,7 +531,7 @@
                     inGenerator()
                 listener: endClassMethod(get, int, =>, null, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Key)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -578,7 +557,7 @@
                 inPlainSync()
                 parseFunctionBody(g, false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement({)
                     parseStatementX({)
                       parseReturnStatement({)
@@ -595,7 +574,6 @@
                                 parsePrimary(+, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(+, expression, ConstantPatternContext.none)
                                     parseSend(+, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(+)
                                       ensureIdentifier(+, expression)
                                         listener: handleIdentifier(runtimeType, expression)
                                       listener: handleNoTypeArguments(.)
@@ -605,7 +583,6 @@
                               parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                   parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                    isNextIdentifier(.)
                                     ensureIdentifier(., expressionContinuation)
                                       listener: handleIdentifier(hashCode, expressionContinuation)
                                     listener: handleNoTypeArguments(xor)
@@ -623,7 +600,6 @@
                               parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                   parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                    isNextIdentifier(.)
                                     ensureIdentifier(., expressionContinuation)
                                     parseArgumentsOpt(hashCode)
                               parsePrecedenceExpression(+, 14, true, ConstantPatternContext.none)
@@ -642,7 +618,6 @@
                               parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                   parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                    isNextIdentifier(.)
                                     ensureIdentifier(., expressionContinuation)
                                       listener: handleIdentifier(hashCode, expressionContinuation)
                                     listener: handleNoTypeArguments(+)
@@ -661,11 +636,11 @@
                         ensureSemicolon(3)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(get, int, {, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Key)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -691,7 +666,7 @@
                 inPlainSync()
                 parseFunctionBody(h, false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement({)
                     parseStatementX({)
                       parseReturnStatement({)
@@ -708,7 +683,6 @@
                                 parsePrimary(+, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(+, expression, ConstantPatternContext.none)
                                     parseSend(+, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(+)
                                       ensureIdentifier(+, expression)
                                         listener: handleIdentifier(runtimeType, expression)
                                       listener: handleNoTypeArguments(.)
@@ -718,7 +692,6 @@
                               parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                   parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                    isNextIdentifier(.)
                                     ensureIdentifier(., expressionContinuation)
                                       listener: handleIdentifier(hashCode, expressionContinuation)
                                     listener: handleNoTypeArguments(^)
@@ -736,7 +709,6 @@
                               parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                   parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                    isNextIdentifier(.)
                                     ensureIdentifier(., expressionContinuation)
                                       listener: handleIdentifier(hashCode, expressionContinuation)
                                     listener: handleNoTypeArguments(+)
@@ -755,11 +727,11 @@
                         ensureSemicolon(3)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(get, int, {, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Key)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -818,7 +790,6 @@
                           parsePrimary(=>, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(=>, expression, ConstantPatternContext.none)
                               parseSend(=>, expression, ConstantPatternContext.none)
-                                isNextIdentifier(=>)
                                 ensureIdentifier(=>, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(xor)
@@ -831,7 +802,6 @@
                             parsePrimary(^, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(^, expression, ConstantPatternContext.none)
                                 parseSend(^, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(^)
                                   ensureIdentifier(^, expression)
                                   parseArgumentsOpt(y)
                         reportRecoverableError(xor, Message[BinaryOperatorWrittenOut, Binary operator 'xor' is written as '^' instead of the written out word., Try replacing 'xor' with '^'., {string: xor, string2: ^}])
@@ -843,7 +813,6 @@
                             parsePrimary(^, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(^, expression, ConstantPatternContext.none)
                                 parseSend(^, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(^)
                                   ensureIdentifier(^, expression)
                                     listener: handleIdentifier(y, expression)
                                   listener: handleNoTypeArguments(;)
@@ -856,7 +825,7 @@
                     inGenerator()
                 listener: endClassMethod(null, int, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Key)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -915,7 +884,6 @@
                           parsePrimary(=>, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(=>, expression, ConstantPatternContext.none)
                               parseSend(=>, expression, ConstantPatternContext.none)
-                                isNextIdentifier(=>)
                                 ensureIdentifier(=>, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(^)
@@ -928,7 +896,6 @@
                             parsePrimary(^, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(^, expression, ConstantPatternContext.none)
                                 parseSend(^, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(^)
                                   ensureIdentifier(^, expression)
                                     listener: handleIdentifier(y, expression)
                                   listener: handleNoTypeArguments(;)
@@ -941,7 +908,7 @@
                     inGenerator()
                 listener: endClassMethod(null, int, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Key)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -994,7 +961,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement({)
                     parseStatementX({)
                       parseReturnStatement({)
@@ -1005,7 +972,6 @@
                               parsePrimary(return, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(xor)
@@ -1018,7 +984,6 @@
                                 parsePrimary(^, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(^, expression, ConstantPatternContext.none)
                                     parseSend(^, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(^)
                                       ensureIdentifier(^, expression)
                                       parseArgumentsOpt(y)
                             reportRecoverableError(xor, Message[BinaryOperatorWrittenOut, Binary operator 'xor' is written as '^' instead of the written out word., Try replacing 'xor' with '^'., {string: xor, string2: ^}])
@@ -1030,7 +995,6 @@
                                 parsePrimary(^, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(^, expression, ConstantPatternContext.none)
                                     parseSend(^, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(^)
                                       ensureIdentifier(^, expression)
                                         listener: handleIdentifier(y, expression)
                                       listener: handleNoTypeArguments(;)
@@ -1041,11 +1005,11 @@
                         ensureSemicolon(y)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Key)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -1098,7 +1062,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement({)
                     parseStatementX({)
                       parseReturnStatement({)
@@ -1109,7 +1073,6 @@
                               parsePrimary(return, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(^)
@@ -1122,7 +1085,6 @@
                                 parsePrimary(^, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(^, expression, ConstantPatternContext.none)
                                     parseSend(^, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(^)
                                       ensureIdentifier(^, expression)
                                         listener: handleIdentifier(y, expression)
                                       listener: handleNoTypeArguments(;)
@@ -1133,11 +1095,11 @@
                         ensureSemicolon(y)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Key)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -1190,7 +1152,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, int)
+                  notEofOrType(CLOSE_CURLY_BRACKET, int)
                   parseStatement({)
                     parseStatementX({)
                       parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -1214,7 +1176,6 @@
                                     parsePrimary(=, expression, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                         parseSend(=, expression, ConstantPatternContext.none)
-                                          isNextIdentifier(=)
                                           ensureIdentifier(=, expression)
                                             listener: handleIdentifier(x, expression)
                                           listener: handleNoTypeArguments(xor)
@@ -1227,7 +1188,6 @@
                                       parsePrimary(^, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral(^, expression, ConstantPatternContext.none)
                                           parseSend(^, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(^)
                                             ensureIdentifier(^, expression)
                                             parseArgumentsOpt(y)
                                   reportRecoverableError(xor, Message[BinaryOperatorWrittenOut, Binary operator 'xor' is written as '^' instead of the written out word., Try replacing 'xor' with '^'., {string: xor, string2: ^}])
@@ -1239,7 +1199,6 @@
                                       parsePrimary(^, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral(^, expression, ConstantPatternContext.none)
                                           parseSend(^, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(^)
                                             ensureIdentifier(^, expression)
                                               listener: handleIdentifier(y, expression)
                                             listener: handleNoTypeArguments(;)
@@ -1251,7 +1210,7 @@
                             listener: endInitializedIdentifier(z)
                           ensureSemicolon(y)
                           listener: endVariablesDeclaration(1, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -1262,7 +1221,6 @@
                               parsePrimary(return, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       listener: handleIdentifier(z, expression)
                                     listener: handleNoTypeArguments(;)
@@ -1272,11 +1230,11 @@
                         ensureSemicolon(z)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Key)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -1329,7 +1287,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, int)
+                  notEofOrType(CLOSE_CURLY_BRACKET, int)
                   parseStatement({)
                     parseStatementX({)
                       parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -1353,7 +1311,6 @@
                                     parsePrimary(=, expression, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                         parseSend(=, expression, ConstantPatternContext.none)
-                                          isNextIdentifier(=)
                                           ensureIdentifier(=, expression)
                                             listener: handleIdentifier(x, expression)
                                           listener: handleNoTypeArguments(^)
@@ -1366,7 +1323,6 @@
                                       parsePrimary(^, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral(^, expression, ConstantPatternContext.none)
                                           parseSend(^, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(^)
                                             ensureIdentifier(^, expression)
                                               listener: handleIdentifier(y, expression)
                                             listener: handleNoTypeArguments(;)
@@ -1378,7 +1334,7 @@
                             listener: endInitializedIdentifier(z)
                           ensureSemicolon(y)
                           listener: endVariablesDeclaration(1, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -1389,7 +1345,6 @@
                               parsePrimary(return, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       listener: handleIdentifier(z, expression)
                                     listener: handleNoTypeArguments(;)
@@ -1399,11 +1354,11 @@
                         ensureSemicolon(z)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Key)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -1468,7 +1423,6 @@
                             parsePrimary(+, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(+, expression, ConstantPatternContext.none)
                                 parseSend(+, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(+)
                                   ensureIdentifier(+, expression)
                                     listener: handleIdentifier(x, expression)
                                   listener: handleNoTypeArguments(xor)
@@ -1483,7 +1437,6 @@
                             parsePrimary(^, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(^, expression, ConstantPatternContext.none)
                                 parseSend(^, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(^)
                                   ensureIdentifier(^, expression)
                                   parseArgumentsOpt(y)
                           parsePrecedenceExpression(+, 14, true, ConstantPatternContext.none)
@@ -1499,7 +1452,6 @@
                             parsePrimary(^, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(^, expression, ConstantPatternContext.none)
                                 parseSend(^, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(^)
                                   ensureIdentifier(^, expression)
                                     listener: handleIdentifier(y, expression)
                                   listener: handleNoTypeArguments(+)
@@ -1519,7 +1471,7 @@
                     inGenerator()
                 listener: endClassMethod(null, int, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Key)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -1584,7 +1536,6 @@
                             parsePrimary(+, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(+, expression, ConstantPatternContext.none)
                                 parseSend(+, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(+)
                                   ensureIdentifier(+, expression)
                                     listener: handleIdentifier(x, expression)
                                   listener: handleNoTypeArguments(^)
@@ -1598,7 +1549,6 @@
                             parsePrimary(^, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(^, expression, ConstantPatternContext.none)
                                 parseSend(^, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(^)
                                   ensureIdentifier(^, expression)
                                     listener: handleIdentifier(y, expression)
                                   listener: handleNoTypeArguments(+)
@@ -1618,7 +1568,7 @@
                     inGenerator()
                 listener: endClassMethod(null, int, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Key)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -1671,7 +1621,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement({)
                     parseStatementX({)
                       parseReturnStatement({)
@@ -1688,7 +1638,6 @@
                                 parsePrimary(+, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(+, expression, ConstantPatternContext.none)
                                     parseSend(+, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(+)
                                       ensureIdentifier(+, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments(xor)
@@ -1703,7 +1652,6 @@
                                 parsePrimary(^, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(^, expression, ConstantPatternContext.none)
                                     parseSend(^, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(^)
                                       ensureIdentifier(^, expression)
                                       parseArgumentsOpt(y)
                               parsePrecedenceExpression(+, 14, true, ConstantPatternContext.none)
@@ -1719,7 +1667,6 @@
                                 parsePrimary(^, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(^, expression, ConstantPatternContext.none)
                                     parseSend(^, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(^)
                                       ensureIdentifier(^, expression)
                                         listener: handleIdentifier(y, expression)
                                       listener: handleNoTypeArguments(+)
@@ -1737,11 +1684,11 @@
                         ensureSemicolon(3)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Key)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -1794,7 +1741,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement({)
                     parseStatementX({)
                       parseReturnStatement({)
@@ -1811,7 +1758,6 @@
                                 parsePrimary(+, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(+, expression, ConstantPatternContext.none)
                                     parseSend(+, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(+)
                                       ensureIdentifier(+, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments(^)
@@ -1825,7 +1771,6 @@
                                 parsePrimary(^, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(^, expression, ConstantPatternContext.none)
                                     parseSend(^, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(^)
                                       ensureIdentifier(^, expression)
                                         listener: handleIdentifier(y, expression)
                                       listener: handleNoTypeArguments(+)
@@ -1843,11 +1788,11 @@
                         ensureSemicolon(3)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, s)
+            notEofOrType(CLOSE_CURLY_BRACKET, s)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Key)
               parseMetadataStar(})
                 listener: beginMetadataStar(s)
@@ -1899,7 +1844,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, s)
+                  notEofOrType(CLOSE_CURLY_BRACKET, s)
                   parseStatement({)
                     parseStatementX({)
                       parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -1912,7 +1857,6 @@
                                   parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                                     looksLikeFunctionBody(;)
                                     parseSend({, expression, ConstantPatternContext.none)
-                                      isNextIdentifier({)
                                       ensureIdentifier({, expression)
                                         listener: handleIdentifier(s, expression)
                                       listener: handleNoTypeArguments(()
@@ -1926,7 +1870,6 @@
                                                   parsePrimary((, expression, ConstantPatternContext.none)
                                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                       parseSend((, expression, ConstantPatternContext.none)
-                                                        isNextIdentifier(()
                                                         ensureIdentifier((, expression)
                                                           listener: handleIdentifier(x, expression)
                                                         listener: handleNoTypeArguments(xor)
@@ -1939,7 +1882,6 @@
                                                     parsePrimary(^, expression, ConstantPatternContext.none)
                                                       parseSendOrFunctionLiteral(^, expression, ConstantPatternContext.none)
                                                         parseSend(^, expression, ConstantPatternContext.none)
-                                                          isNextIdentifier(^)
                                                           ensureIdentifier(^, expression)
                                                           parseArgumentsOpt(y)
                                                 reportRecoverableError(xor, Message[BinaryOperatorWrittenOut, Binary operator 'xor' is written as '^' instead of the written out word., Try replacing 'xor' with '^'., {string: xor, string2: ^}])
@@ -1951,7 +1893,6 @@
                                                     parsePrimary(^, expression, ConstantPatternContext.none)
                                                       parseSendOrFunctionLiteral(^, expression, ConstantPatternContext.none)
                                                         parseSend(^, expression, ConstantPatternContext.none)
-                                                          isNextIdentifier(^)
                                                           ensureIdentifier(^, expression)
                                                             listener: handleIdentifier(y, expression)
                                                           listener: handleNoTypeArguments(,)
@@ -1965,7 +1906,6 @@
                                                   parsePrimary(,, expression, ConstantPatternContext.none)
                                                     parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                                       parseSend(,, expression, ConstantPatternContext.none)
-                                                        isNextIdentifier(,)
                                                         ensureIdentifier(,, expression)
                                                           listener: handleIdentifier(x, expression)
                                                         listener: handleNoTypeArguments(xor)
@@ -1978,7 +1918,6 @@
                                                     parsePrimary(^, expression, ConstantPatternContext.none)
                                                       parseSendOrFunctionLiteral(^, expression, ConstantPatternContext.none)
                                                         parseSend(^, expression, ConstantPatternContext.none)
-                                                          isNextIdentifier(^)
                                                           ensureIdentifier(^, expression)
                                                           parseArgumentsOpt(y)
                                                 reportRecoverableError(xor, Message[BinaryOperatorWrittenOut, Binary operator 'xor' is written as '^' instead of the written out word., Try replacing 'xor' with '^'., {string: xor, string2: ^}])
@@ -1990,7 +1929,6 @@
                                                     parsePrimary(^, expression, ConstantPatternContext.none)
                                                       parseSendOrFunctionLiteral(^, expression, ConstantPatternContext.none)
                                                         parseSend(^, expression, ConstantPatternContext.none)
-                                                          isNextIdentifier(^)
                                                           ensureIdentifier(^, expression)
                                                             listener: handleIdentifier(y, expression)
                                                           listener: handleNoTypeArguments())
@@ -2002,7 +1940,7 @@
                                       listener: handleSend(s, ))
                           ensureSemicolon())
                           listener: handleExpressionStatement(s, ;)
-                  notEofOrValue(}, s)
+                  notEofOrType(CLOSE_CURLY_BRACKET, s)
                   parseStatement(;)
                     parseStatementX(;)
                       parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -2015,7 +1953,6 @@
                                   parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                                     looksLikeFunctionBody(;)
                                     parseSend(;, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(;)
                                       ensureIdentifier(;, expression)
                                         listener: handleIdentifier(s, expression)
                                       listener: handleNoTypeArguments(()
@@ -2029,7 +1966,6 @@
                                                   parsePrimary((, expression, ConstantPatternContext.none)
                                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                       parseSend((, expression, ConstantPatternContext.none)
-                                                        isNextIdentifier(()
                                                         ensureIdentifier((, expression)
                                                           listener: handleIdentifier(x, expression)
                                                         listener: handleNoTypeArguments(^)
@@ -2042,7 +1978,6 @@
                                                     parsePrimary(^, expression, ConstantPatternContext.none)
                                                       parseSendOrFunctionLiteral(^, expression, ConstantPatternContext.none)
                                                         parseSend(^, expression, ConstantPatternContext.none)
-                                                          isNextIdentifier(^)
                                                           ensureIdentifier(^, expression)
                                                             listener: handleIdentifier(y, expression)
                                                           listener: handleNoTypeArguments(,)
@@ -2056,7 +1991,6 @@
                                                   parsePrimary(,, expression, ConstantPatternContext.none)
                                                     parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                                       parseSend(,, expression, ConstantPatternContext.none)
-                                                        isNextIdentifier(,)
                                                         ensureIdentifier(,, expression)
                                                           listener: handleIdentifier(x, expression)
                                                         listener: handleNoTypeArguments(^)
@@ -2069,7 +2003,6 @@
                                                     parsePrimary(^, expression, ConstantPatternContext.none)
                                                       parseSendOrFunctionLiteral(^, expression, ConstantPatternContext.none)
                                                         parseSend(^, expression, ConstantPatternContext.none)
-                                                          isNextIdentifier(^)
                                                           ensureIdentifier(^, expression)
                                                             listener: handleIdentifier(y, expression)
                                                           listener: handleNoTypeArguments())
@@ -2081,11 +2014,11 @@
                                       listener: handleSend(s, ))
                           ensureSemicolon())
                           listener: handleExpressionStatement(s, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, s, (, null, })
               listener: endMember()
-            notEofOrValue(}, Key)
+            notEofOrType(CLOSE_CURLY_BRACKET, Key)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Key)
               parseMetadataStar(})
                 listener: beginMetadataStar(Key)
@@ -2141,7 +2074,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(foo, expression)
                                     listener: handleNoTypeArguments(=)
@@ -2153,7 +2085,6 @@
                                 parsePrimary(=, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                     parseSend(=, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(=)
                                       ensureIdentifier(=, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments(xor)
@@ -2166,7 +2097,6 @@
                                   parsePrimary(^, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(^, expression, ConstantPatternContext.none)
                                       parseSend(^, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(^)
                                         ensureIdentifier(^, expression)
                                         parseArgumentsOpt(y)
                               reportRecoverableError(xor, Message[BinaryOperatorWrittenOut, Binary operator 'xor' is written as '^' instead of the written out word., Try replacing 'xor' with '^'., {string: xor, string2: ^}])
@@ -2178,7 +2108,6 @@
                                   parsePrimary(^, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(^, expression, ConstantPatternContext.none)
                                       parseSend(^, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(^)
                                         ensureIdentifier(^, expression)
                                           listener: handleIdentifier(y, expression)
                                         listener: handleNoTypeArguments(,)
@@ -2197,7 +2126,6 @@
                               parsePrimary(,, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                   parseSend(,, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(,)
                                     ensureIdentifier(,, expression)
                                       listener: handleIdentifier(bar, expression)
                                     listener: handleNoTypeArguments(=)
@@ -2209,7 +2137,6 @@
                                 parsePrimary(=, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                     parseSend(=, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(=)
                                       ensureIdentifier(=, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments(xor)
@@ -2222,7 +2149,6 @@
                                   parsePrimary(^, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(^, expression, ConstantPatternContext.none)
                                       parseSend(^, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(^)
                                         ensureIdentifier(^, expression)
                                         parseArgumentsOpt(y)
                               reportRecoverableError(xor, Message[BinaryOperatorWrittenOut, Binary operator 'xor' is written as '^' instead of the written out word., Try replacing 'xor' with '^'., {string: xor, string2: ^}])
@@ -2234,7 +2160,6 @@
                                   parsePrimary(^, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(^, expression, ConstantPatternContext.none)
                                       parseSend(^, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(^)
                                         ensureIdentifier(^, expression)
                                           listener: handleIdentifier(y, expression)
                                         listener: handleNoTypeArguments({)
@@ -2251,7 +2176,7 @@
                 inPlainSync()
                 parseFunctionBody(y, false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, print)
+                  notEofOrType(CLOSE_CURLY_BRACKET, print)
                   parseStatement({)
                     parseStatementX({)
                       parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -2264,7 +2189,6 @@
                                   parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                                     looksLikeFunctionBody(;)
                                     parseSend({, expression, ConstantPatternContext.none)
-                                      isNextIdentifier({)
                                       ensureIdentifier({, expression)
                                         listener: handleIdentifier(print, expression)
                                       listener: handleNoTypeArguments(()
@@ -2285,7 +2209,6 @@
                                                               parsePrimary(${, expression, ConstantPatternContext.none)
                                                                 parseSendOrFunctionLiteral(${, expression, ConstantPatternContext.none)
                                                                   parseSend(${, expression, ConstantPatternContext.none)
-                                                                    isNextIdentifier(${)
                                                                     ensureIdentifier(${, expression)
                                                                       listener: handleIdentifier(x, expression)
                                                                     listener: handleNoTypeArguments(xor)
@@ -2298,7 +2221,6 @@
                                                                 parsePrimary(^, expression, ConstantPatternContext.none)
                                                                   parseSendOrFunctionLiteral(^, expression, ConstantPatternContext.none)
                                                                     parseSend(^, expression, ConstantPatternContext.none)
-                                                                      isNextIdentifier(^)
                                                                       ensureIdentifier(^, expression)
                                                                       parseArgumentsOpt(y)
                                                             reportRecoverableError(xor, Message[BinaryOperatorWrittenOut, Binary operator 'xor' is written as '^' instead of the written out word., Try replacing 'xor' with '^'., {string: xor, string2: ^}])
@@ -2310,7 +2232,6 @@
                                                                 parsePrimary(^, expression, ConstantPatternContext.none)
                                                                   parseSendOrFunctionLiteral(^, expression, ConstantPatternContext.none)
                                                                     parseSend(^, expression, ConstantPatternContext.none)
-                                                                      isNextIdentifier(^)
                                                                       ensureIdentifier(^, expression)
                                                                         listener: handleIdentifier(y, expression)
                                                                       listener: handleNoTypeArguments(})
@@ -2326,11 +2247,11 @@
                                       listener: handleSend(print, ))
                           ensureSemicolon())
                           listener: handleExpressionStatement(print, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassConstructor(null, Key, (, :, })
               listener: endMember()
-            notEofOrValue(}, Key)
+            notEofOrType(CLOSE_CURLY_BRACKET, Key)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Key)
               parseMetadataStar(})
                 listener: beginMetadataStar(Key)
@@ -2386,7 +2307,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(foo, expression)
                                     listener: handleNoTypeArguments(=)
@@ -2398,7 +2318,6 @@
                                 parsePrimary(=, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                     parseSend(=, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(=)
                                       ensureIdentifier(=, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments(^)
@@ -2411,7 +2330,6 @@
                                   parsePrimary(^, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(^, expression, ConstantPatternContext.none)
                                       parseSend(^, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(^)
                                         ensureIdentifier(^, expression)
                                           listener: handleIdentifier(y, expression)
                                         listener: handleNoTypeArguments(,)
@@ -2430,7 +2348,6 @@
                               parsePrimary(,, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                   parseSend(,, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(,)
                                     ensureIdentifier(,, expression)
                                       listener: handleIdentifier(bar, expression)
                                     listener: handleNoTypeArguments(=)
@@ -2442,7 +2359,6 @@
                                 parsePrimary(=, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                     parseSend(=, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(=)
                                       ensureIdentifier(=, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments(^)
@@ -2455,7 +2371,6 @@
                                   parsePrimary(^, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(^, expression, ConstantPatternContext.none)
                                       parseSend(^, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(^)
                                         ensureIdentifier(^, expression)
                                           listener: handleIdentifier(y, expression)
                                         listener: handleNoTypeArguments({)
@@ -2472,7 +2387,7 @@
                 inPlainSync()
                 parseFunctionBody(y, false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, print)
+                  notEofOrType(CLOSE_CURLY_BRACKET, print)
                   parseStatement({)
                     parseStatementX({)
                       parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -2485,7 +2400,6 @@
                                   parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                                     looksLikeFunctionBody(;)
                                     parseSend({, expression, ConstantPatternContext.none)
-                                      isNextIdentifier({)
                                       ensureIdentifier({, expression)
                                         listener: handleIdentifier(print, expression)
                                       listener: handleNoTypeArguments(()
@@ -2506,7 +2420,6 @@
                                                               parsePrimary(${, expression, ConstantPatternContext.none)
                                                                 parseSendOrFunctionLiteral(${, expression, ConstantPatternContext.none)
                                                                   parseSend(${, expression, ConstantPatternContext.none)
-                                                                    isNextIdentifier(${)
                                                                     ensureIdentifier(${, expression)
                                                                       listener: handleIdentifier(x, expression)
                                                                     listener: handleNoTypeArguments(^)
@@ -2519,7 +2432,6 @@
                                                                 parsePrimary(^, expression, ConstantPatternContext.none)
                                                                   parseSendOrFunctionLiteral(^, expression, ConstantPatternContext.none)
                                                                     parseSend(^, expression, ConstantPatternContext.none)
-                                                                      isNextIdentifier(^)
                                                                       ensureIdentifier(^, expression)
                                                                         listener: handleIdentifier(y, expression)
                                                                       listener: handleNoTypeArguments(})
@@ -2535,11 +2447,11 @@
                                       listener: handleSend(print, ))
                           ensureSemicolon())
                           listener: handleExpressionStatement(print, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassConstructor(null, Key, (, :, })
               listener: endMember()
-            notEofOrValue(}, not_currently_working)
+            notEofOrType(CLOSE_CURLY_BRACKET, not_currently_working)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Key)
               parseMetadataStar(})
                 listener: beginMetadataStar(not_currently_working)
@@ -2591,7 +2503,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, x)
+                  notEofOrType(CLOSE_CURLY_BRACKET, x)
                   parseStatement({)
                     parseStatementX({)
                       parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -2615,7 +2527,7 @@
                               listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], xor, xor)
                             rewriter()
                           listener: endVariablesDeclaration(1, ;)
-                  notEofOrValue(}, y)
+                  notEofOrType(CLOSE_CURLY_BRACKET, y)
                   parseStatement(;)
                     parseStatementX(;)
                       parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -2627,7 +2539,6 @@
                                 parsePrimary(;, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                                     parseSend(;, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(;)
                                       ensureIdentifier(;, expression)
                                         listener: handleIdentifier(y, expression)
                                       listener: handleNoTypeArguments(;)
@@ -2636,7 +2547,7 @@
                                       listener: handleSend(y, y)
                           ensureSemicolon(y)
                           listener: handleExpressionStatement(y, ;)
-                  notEofOrValue(}, x)
+                  notEofOrType(CLOSE_CURLY_BRACKET, x)
                   parseStatement(;)
                     parseStatementX(;)
                       parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -2648,7 +2559,6 @@
                                 parsePrimary(;, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                                     parseSend(;, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(;)
                                       ensureIdentifier(;, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments(^)
@@ -2661,7 +2571,6 @@
                                   parsePrimary(^, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(^, expression, ConstantPatternContext.none)
                                       parseSend(^, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(^)
                                         ensureIdentifier(^, expression)
                                           listener: handleIdentifier(y, expression)
                                         listener: handleNoTypeArguments(;)
@@ -2671,11 +2580,11 @@
                               listener: endBinaryExpression(^, y)
                           ensureSemicolon(y)
                           listener: handleExpressionStatement(x, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(3, {, })
                 listener: endClassMethod(null, not_currently_working, (, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 22, {, })
           listener: endClassDeclaration(abstract, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_26810_and.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_26810_and.dart.intertwined.expect
index 990cfa4..5b1f725 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_26810_and.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_26810_and.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(abstract, class, null)
           parseClassOrMixinOrExtensionBody(Key, DeclarationKind.Class, Key)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Key)
               parseMetadataStar({)
                 listener: beginMetadataStar(int)
@@ -57,7 +57,6 @@
                           parsePrimary(=>, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(=>, expression, ConstantPatternContext.none)
                               parseSend(=>, expression, ConstantPatternContext.none)
-                                isNextIdentifier(=>)
                                 ensureIdentifier(=>, expression)
                                   listener: handleIdentifier(runtimeType, expression)
                                 listener: handleNoTypeArguments(.)
@@ -67,7 +66,6 @@
                         parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                             parseSend(., expressionContinuation, ConstantPatternContext.none)
-                              isNextIdentifier(.)
                               ensureIdentifier(., expressionContinuation)
                                 listener: handleIdentifier(hashCode, expressionContinuation)
                               listener: handleNoTypeArguments(and)
@@ -83,7 +81,6 @@
                           parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                               parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                isNextIdentifier(.)
                                 ensureIdentifier(., expressionContinuation)
                                 parseArgumentsOpt(hashCode)
                         reportRecoverableError(and, Message[BinaryOperatorWrittenOut, Binary operator 'and' is written as '&' instead of the written out word., Try replacing 'and' with '&'., {string: and, string2: &}])
@@ -98,7 +95,6 @@
                           parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                               parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                isNextIdentifier(.)
                                 ensureIdentifier(., expressionContinuation)
                                   listener: handleIdentifier(hashCode, expressionContinuation)
                                 listener: handleNoTypeArguments(;)
@@ -112,7 +108,7 @@
                     inGenerator()
                 listener: endClassMethod(get, int, =>, null, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Key)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -144,7 +140,6 @@
                           parsePrimary(=>, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(=>, expression, ConstantPatternContext.none)
                               parseSend(=>, expression, ConstantPatternContext.none)
-                                isNextIdentifier(=>)
                                 ensureIdentifier(=>, expression)
                                   listener: handleIdentifier(runtimeType, expression)
                                 listener: handleNoTypeArguments(.)
@@ -154,7 +149,6 @@
                         parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                             parseSend(., expressionContinuation, ConstantPatternContext.none)
-                              isNextIdentifier(.)
                               ensureIdentifier(., expressionContinuation)
                                 listener: handleIdentifier(hashCode, expressionContinuation)
                               listener: handleNoTypeArguments(&)
@@ -171,7 +165,6 @@
                           parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                               parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                isNextIdentifier(.)
                                 ensureIdentifier(., expressionContinuation)
                                   listener: handleIdentifier(hashCode, expressionContinuation)
                                 listener: handleNoTypeArguments(;)
@@ -185,7 +178,7 @@
                     inGenerator()
                 listener: endClassMethod(get, int, =>, null, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Key)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -211,7 +204,7 @@
                 inPlainSync()
                 parseFunctionBody(c, false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement({)
                     parseStatementX({)
                       parseReturnStatement({)
@@ -222,7 +215,6 @@
                               parsePrimary(return, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       listener: handleIdentifier(runtimeType, expression)
                                     listener: handleNoTypeArguments(.)
@@ -232,7 +224,6 @@
                             parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                 parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                  isNextIdentifier(.)
                                   ensureIdentifier(., expressionContinuation)
                                     listener: handleIdentifier(hashCode, expressionContinuation)
                                   listener: handleNoTypeArguments(and)
@@ -248,7 +239,6 @@
                               parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                   parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                    isNextIdentifier(.)
                                     ensureIdentifier(., expressionContinuation)
                                     parseArgumentsOpt(hashCode)
                             reportRecoverableError(and, Message[BinaryOperatorWrittenOut, Binary operator 'and' is written as '&' instead of the written out word., Try replacing 'and' with '&'., {string: and, string2: &}])
@@ -263,7 +253,6 @@
                               parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                   parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                    isNextIdentifier(.)
                                     ensureIdentifier(., expressionContinuation)
                                       listener: handleIdentifier(hashCode, expressionContinuation)
                                     listener: handleNoTypeArguments(;)
@@ -275,11 +264,11 @@
                         ensureSemicolon(hashCode)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(get, int, {, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Key)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -305,7 +294,7 @@
                 inPlainSync()
                 parseFunctionBody(d, false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement({)
                     parseStatementX({)
                       parseReturnStatement({)
@@ -316,7 +305,6 @@
                               parsePrimary(return, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       listener: handleIdentifier(runtimeType, expression)
                                     listener: handleNoTypeArguments(.)
@@ -326,7 +314,6 @@
                             parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                 parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                  isNextIdentifier(.)
                                   ensureIdentifier(., expressionContinuation)
                                     listener: handleIdentifier(hashCode, expressionContinuation)
                                   listener: handleNoTypeArguments(&)
@@ -343,7 +330,6 @@
                               parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                   parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                    isNextIdentifier(.)
                                     ensureIdentifier(., expressionContinuation)
                                       listener: handleIdentifier(hashCode, expressionContinuation)
                                     listener: handleNoTypeArguments(;)
@@ -355,11 +341,11 @@
                         ensureSemicolon(hashCode)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(get, int, {, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Key)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -397,7 +383,6 @@
                             parsePrimary(+, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(+, expression, ConstantPatternContext.none)
                                 parseSend(+, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(+)
                                   ensureIdentifier(+, expression)
                                     listener: handleIdentifier(runtimeType, expression)
                                   listener: handleNoTypeArguments(.)
@@ -407,7 +392,6 @@
                           parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                               parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                isNextIdentifier(.)
                                 ensureIdentifier(., expressionContinuation)
                                   listener: handleIdentifier(hashCode, expressionContinuation)
                                 listener: handleNoTypeArguments(and)
@@ -426,7 +410,6 @@
                           parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                               parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                isNextIdentifier(.)
                                 ensureIdentifier(., expressionContinuation)
                                 parseArgumentsOpt(hashCode)
                           parsePrecedenceExpression(+, 14, true, ConstantPatternContext.none)
@@ -445,7 +428,6 @@
                           parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                               parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                isNextIdentifier(.)
                                 ensureIdentifier(., expressionContinuation)
                                   listener: handleIdentifier(hashCode, expressionContinuation)
                                 listener: handleNoTypeArguments(+)
@@ -466,7 +448,7 @@
                     inGenerator()
                 listener: endClassMethod(get, int, =>, null, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Key)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -504,7 +486,6 @@
                             parsePrimary(+, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(+, expression, ConstantPatternContext.none)
                                 parseSend(+, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(+)
                                   ensureIdentifier(+, expression)
                                     listener: handleIdentifier(runtimeType, expression)
                                   listener: handleNoTypeArguments(.)
@@ -514,7 +495,6 @@
                           parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                               parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                isNextIdentifier(.)
                                 ensureIdentifier(., expressionContinuation)
                                   listener: handleIdentifier(hashCode, expressionContinuation)
                                 listener: handleNoTypeArguments(&)
@@ -532,7 +512,6 @@
                           parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                               parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                isNextIdentifier(.)
                                 ensureIdentifier(., expressionContinuation)
                                   listener: handleIdentifier(hashCode, expressionContinuation)
                                 listener: handleNoTypeArguments(+)
@@ -553,7 +532,7 @@
                     inGenerator()
                 listener: endClassMethod(get, int, =>, null, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Key)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -579,7 +558,7 @@
                 inPlainSync()
                 parseFunctionBody(g, false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement({)
                     parseStatementX({)
                       parseReturnStatement({)
@@ -596,7 +575,6 @@
                                 parsePrimary(+, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(+, expression, ConstantPatternContext.none)
                                     parseSend(+, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(+)
                                       ensureIdentifier(+, expression)
                                         listener: handleIdentifier(runtimeType, expression)
                                       listener: handleNoTypeArguments(.)
@@ -606,7 +584,6 @@
                               parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                   parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                    isNextIdentifier(.)
                                     ensureIdentifier(., expressionContinuation)
                                       listener: handleIdentifier(hashCode, expressionContinuation)
                                     listener: handleNoTypeArguments(and)
@@ -625,7 +602,6 @@
                               parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                   parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                    isNextIdentifier(.)
                                     ensureIdentifier(., expressionContinuation)
                                     parseArgumentsOpt(hashCode)
                               parsePrecedenceExpression(+, 14, true, ConstantPatternContext.none)
@@ -644,7 +620,6 @@
                               parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                   parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                    isNextIdentifier(.)
                                     ensureIdentifier(., expressionContinuation)
                                       listener: handleIdentifier(hashCode, expressionContinuation)
                                     listener: handleNoTypeArguments(+)
@@ -663,11 +638,11 @@
                         ensureSemicolon(3)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(get, int, {, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Key)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -693,7 +668,7 @@
                 inPlainSync()
                 parseFunctionBody(h, false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement({)
                     parseStatementX({)
                       parseReturnStatement({)
@@ -710,7 +685,6 @@
                                 parsePrimary(+, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(+, expression, ConstantPatternContext.none)
                                     parseSend(+, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(+)
                                       ensureIdentifier(+, expression)
                                         listener: handleIdentifier(runtimeType, expression)
                                       listener: handleNoTypeArguments(.)
@@ -720,7 +694,6 @@
                               parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                   parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                    isNextIdentifier(.)
                                     ensureIdentifier(., expressionContinuation)
                                       listener: handleIdentifier(hashCode, expressionContinuation)
                                     listener: handleNoTypeArguments(&)
@@ -738,7 +711,6 @@
                               parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                   parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                    isNextIdentifier(.)
                                     ensureIdentifier(., expressionContinuation)
                                       listener: handleIdentifier(hashCode, expressionContinuation)
                                     listener: handleNoTypeArguments(+)
@@ -757,11 +729,11 @@
                         ensureSemicolon(3)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(get, int, {, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Key)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -820,7 +792,6 @@
                           parsePrimary(=>, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(=>, expression, ConstantPatternContext.none)
                               parseSend(=>, expression, ConstantPatternContext.none)
-                                isNextIdentifier(=>)
                                 ensureIdentifier(=>, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(and)
@@ -833,7 +804,6 @@
                             parsePrimary(&, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(&, expression, ConstantPatternContext.none)
                                 parseSend(&, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(&)
                                   ensureIdentifier(&, expression)
                                   parseArgumentsOpt(y)
                         reportRecoverableError(and, Message[BinaryOperatorWrittenOut, Binary operator 'and' is written as '&' instead of the written out word., Try replacing 'and' with '&'., {string: and, string2: &}])
@@ -845,7 +815,6 @@
                             parsePrimary(&, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(&, expression, ConstantPatternContext.none)
                                 parseSend(&, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(&)
                                   ensureIdentifier(&, expression)
                                     listener: handleIdentifier(y, expression)
                                   listener: handleNoTypeArguments(;)
@@ -858,7 +827,7 @@
                     inGenerator()
                 listener: endClassMethod(null, int, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Key)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -917,7 +886,6 @@
                           parsePrimary(=>, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(=>, expression, ConstantPatternContext.none)
                               parseSend(=>, expression, ConstantPatternContext.none)
-                                isNextIdentifier(=>)
                                 ensureIdentifier(=>, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(&)
@@ -930,7 +898,6 @@
                             parsePrimary(&, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(&, expression, ConstantPatternContext.none)
                                 parseSend(&, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(&)
                                   ensureIdentifier(&, expression)
                                     listener: handleIdentifier(y, expression)
                                   listener: handleNoTypeArguments(;)
@@ -943,7 +910,7 @@
                     inGenerator()
                 listener: endClassMethod(null, int, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Key)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -996,7 +963,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement({)
                     parseStatementX({)
                       parseReturnStatement({)
@@ -1007,7 +974,6 @@
                               parsePrimary(return, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(and)
@@ -1020,7 +986,6 @@
                                 parsePrimary(&, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(&, expression, ConstantPatternContext.none)
                                     parseSend(&, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(&)
                                       ensureIdentifier(&, expression)
                                       parseArgumentsOpt(y)
                             reportRecoverableError(and, Message[BinaryOperatorWrittenOut, Binary operator 'and' is written as '&' instead of the written out word., Try replacing 'and' with '&'., {string: and, string2: &}])
@@ -1032,7 +997,6 @@
                                 parsePrimary(&, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(&, expression, ConstantPatternContext.none)
                                     parseSend(&, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(&)
                                       ensureIdentifier(&, expression)
                                         listener: handleIdentifier(y, expression)
                                       listener: handleNoTypeArguments(;)
@@ -1043,11 +1007,11 @@
                         ensureSemicolon(y)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Key)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -1100,7 +1064,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement({)
                     parseStatementX({)
                       parseReturnStatement({)
@@ -1111,7 +1075,6 @@
                               parsePrimary(return, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(&)
@@ -1124,7 +1087,6 @@
                                 parsePrimary(&, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(&, expression, ConstantPatternContext.none)
                                     parseSend(&, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(&)
                                       ensureIdentifier(&, expression)
                                         listener: handleIdentifier(y, expression)
                                       listener: handleNoTypeArguments(;)
@@ -1135,11 +1097,11 @@
                         ensureSemicolon(y)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Key)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -1192,7 +1154,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, int)
+                  notEofOrType(CLOSE_CURLY_BRACKET, int)
                   parseStatement({)
                     parseStatementX({)
                       parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -1216,7 +1178,6 @@
                                     parsePrimary(=, expression, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                         parseSend(=, expression, ConstantPatternContext.none)
-                                          isNextIdentifier(=)
                                           ensureIdentifier(=, expression)
                                             listener: handleIdentifier(x, expression)
                                           listener: handleNoTypeArguments(and)
@@ -1229,7 +1190,6 @@
                                       parsePrimary(&, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral(&, expression, ConstantPatternContext.none)
                                           parseSend(&, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(&)
                                             ensureIdentifier(&, expression)
                                             parseArgumentsOpt(y)
                                   reportRecoverableError(and, Message[BinaryOperatorWrittenOut, Binary operator 'and' is written as '&' instead of the written out word., Try replacing 'and' with '&'., {string: and, string2: &}])
@@ -1241,7 +1201,6 @@
                                       parsePrimary(&, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral(&, expression, ConstantPatternContext.none)
                                           parseSend(&, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(&)
                                             ensureIdentifier(&, expression)
                                               listener: handleIdentifier(y, expression)
                                             listener: handleNoTypeArguments(;)
@@ -1253,7 +1212,7 @@
                             listener: endInitializedIdentifier(z)
                           ensureSemicolon(y)
                           listener: endVariablesDeclaration(1, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -1264,7 +1223,6 @@
                               parsePrimary(return, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       listener: handleIdentifier(z, expression)
                                     listener: handleNoTypeArguments(;)
@@ -1274,11 +1232,11 @@
                         ensureSemicolon(z)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Key)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -1331,7 +1289,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, int)
+                  notEofOrType(CLOSE_CURLY_BRACKET, int)
                   parseStatement({)
                     parseStatementX({)
                       parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -1355,7 +1313,6 @@
                                     parsePrimary(=, expression, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                         parseSend(=, expression, ConstantPatternContext.none)
-                                          isNextIdentifier(=)
                                           ensureIdentifier(=, expression)
                                             listener: handleIdentifier(x, expression)
                                           listener: handleNoTypeArguments(&)
@@ -1368,7 +1325,6 @@
                                       parsePrimary(&, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral(&, expression, ConstantPatternContext.none)
                                           parseSend(&, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(&)
                                             ensureIdentifier(&, expression)
                                               listener: handleIdentifier(y, expression)
                                             listener: handleNoTypeArguments(;)
@@ -1380,7 +1336,7 @@
                             listener: endInitializedIdentifier(z)
                           ensureSemicolon(y)
                           listener: endVariablesDeclaration(1, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -1391,7 +1347,6 @@
                               parsePrimary(return, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       listener: handleIdentifier(z, expression)
                                     listener: handleNoTypeArguments(;)
@@ -1401,11 +1356,11 @@
                         ensureSemicolon(z)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Key)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -1470,7 +1425,6 @@
                             parsePrimary(+, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(+, expression, ConstantPatternContext.none)
                                 parseSend(+, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(+)
                                   ensureIdentifier(+, expression)
                                     listener: handleIdentifier(x, expression)
                                   listener: handleNoTypeArguments(and)
@@ -1486,7 +1440,6 @@
                             parsePrimary(&, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(&, expression, ConstantPatternContext.none)
                                 parseSend(&, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(&)
                                   ensureIdentifier(&, expression)
                                   parseArgumentsOpt(y)
                           parsePrecedenceExpression(+, 14, true, ConstantPatternContext.none)
@@ -1502,7 +1455,6 @@
                             parsePrimary(&, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(&, expression, ConstantPatternContext.none)
                                 parseSend(&, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(&)
                                   ensureIdentifier(&, expression)
                                     listener: handleIdentifier(y, expression)
                                   listener: handleNoTypeArguments(+)
@@ -1522,7 +1474,7 @@
                     inGenerator()
                 listener: endClassMethod(null, int, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Key)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -1587,7 +1539,6 @@
                             parsePrimary(+, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(+, expression, ConstantPatternContext.none)
                                 parseSend(+, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(+)
                                   ensureIdentifier(+, expression)
                                     listener: handleIdentifier(x, expression)
                                   listener: handleNoTypeArguments(&)
@@ -1601,7 +1552,6 @@
                             parsePrimary(&, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(&, expression, ConstantPatternContext.none)
                                 parseSend(&, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(&)
                                   ensureIdentifier(&, expression)
                                     listener: handleIdentifier(y, expression)
                                   listener: handleNoTypeArguments(+)
@@ -1621,7 +1571,7 @@
                     inGenerator()
                 listener: endClassMethod(null, int, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Key)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -1674,7 +1624,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement({)
                     parseStatementX({)
                       parseReturnStatement({)
@@ -1691,7 +1641,6 @@
                                 parsePrimary(+, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(+, expression, ConstantPatternContext.none)
                                     parseSend(+, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(+)
                                       ensureIdentifier(+, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments(and)
@@ -1707,7 +1656,6 @@
                                 parsePrimary(&, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(&, expression, ConstantPatternContext.none)
                                     parseSend(&, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(&)
                                       ensureIdentifier(&, expression)
                                       parseArgumentsOpt(y)
                               parsePrecedenceExpression(+, 14, true, ConstantPatternContext.none)
@@ -1723,7 +1671,6 @@
                                 parsePrimary(&, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(&, expression, ConstantPatternContext.none)
                                     parseSend(&, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(&)
                                       ensureIdentifier(&, expression)
                                         listener: handleIdentifier(y, expression)
                                       listener: handleNoTypeArguments(+)
@@ -1741,11 +1688,11 @@
                         ensureSemicolon(3)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Key)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -1798,7 +1745,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement({)
                     parseStatementX({)
                       parseReturnStatement({)
@@ -1815,7 +1762,6 @@
                                 parsePrimary(+, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(+, expression, ConstantPatternContext.none)
                                     parseSend(+, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(+)
                                       ensureIdentifier(+, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments(&)
@@ -1829,7 +1775,6 @@
                                 parsePrimary(&, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(&, expression, ConstantPatternContext.none)
                                     parseSend(&, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(&)
                                       ensureIdentifier(&, expression)
                                         listener: handleIdentifier(y, expression)
                                       listener: handleNoTypeArguments(+)
@@ -1847,11 +1792,11 @@
                         ensureSemicolon(3)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, s)
+            notEofOrType(CLOSE_CURLY_BRACKET, s)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Key)
               parseMetadataStar(})
                 listener: beginMetadataStar(s)
@@ -1903,7 +1848,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, s)
+                  notEofOrType(CLOSE_CURLY_BRACKET, s)
                   parseStatement({)
                     parseStatementX({)
                       parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -1916,7 +1861,6 @@
                                   parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                                     looksLikeFunctionBody(;)
                                     parseSend({, expression, ConstantPatternContext.none)
-                                      isNextIdentifier({)
                                       ensureIdentifier({, expression)
                                         listener: handleIdentifier(s, expression)
                                       listener: handleNoTypeArguments(()
@@ -1930,7 +1874,6 @@
                                                   parsePrimary((, expression, ConstantPatternContext.none)
                                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                       parseSend((, expression, ConstantPatternContext.none)
-                                                        isNextIdentifier(()
                                                         ensureIdentifier((, expression)
                                                           listener: handleIdentifier(x, expression)
                                                         listener: handleNoTypeArguments(and)
@@ -1943,7 +1886,6 @@
                                                     parsePrimary(&, expression, ConstantPatternContext.none)
                                                       parseSendOrFunctionLiteral(&, expression, ConstantPatternContext.none)
                                                         parseSend(&, expression, ConstantPatternContext.none)
-                                                          isNextIdentifier(&)
                                                           ensureIdentifier(&, expression)
                                                           parseArgumentsOpt(y)
                                                 reportRecoverableError(and, Message[BinaryOperatorWrittenOut, Binary operator 'and' is written as '&' instead of the written out word., Try replacing 'and' with '&'., {string: and, string2: &}])
@@ -1955,7 +1897,6 @@
                                                     parsePrimary(&, expression, ConstantPatternContext.none)
                                                       parseSendOrFunctionLiteral(&, expression, ConstantPatternContext.none)
                                                         parseSend(&, expression, ConstantPatternContext.none)
-                                                          isNextIdentifier(&)
                                                           ensureIdentifier(&, expression)
                                                             listener: handleIdentifier(y, expression)
                                                           listener: handleNoTypeArguments(,)
@@ -1969,7 +1910,6 @@
                                                   parsePrimary(,, expression, ConstantPatternContext.none)
                                                     parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                                       parseSend(,, expression, ConstantPatternContext.none)
-                                                        isNextIdentifier(,)
                                                         ensureIdentifier(,, expression)
                                                           listener: handleIdentifier(x, expression)
                                                         listener: handleNoTypeArguments(and)
@@ -1982,7 +1922,6 @@
                                                     parsePrimary(&, expression, ConstantPatternContext.none)
                                                       parseSendOrFunctionLiteral(&, expression, ConstantPatternContext.none)
                                                         parseSend(&, expression, ConstantPatternContext.none)
-                                                          isNextIdentifier(&)
                                                           ensureIdentifier(&, expression)
                                                           parseArgumentsOpt(y)
                                                 reportRecoverableError(and, Message[BinaryOperatorWrittenOut, Binary operator 'and' is written as '&' instead of the written out word., Try replacing 'and' with '&'., {string: and, string2: &}])
@@ -1994,7 +1933,6 @@
                                                     parsePrimary(&, expression, ConstantPatternContext.none)
                                                       parseSendOrFunctionLiteral(&, expression, ConstantPatternContext.none)
                                                         parseSend(&, expression, ConstantPatternContext.none)
-                                                          isNextIdentifier(&)
                                                           ensureIdentifier(&, expression)
                                                             listener: handleIdentifier(y, expression)
                                                           listener: handleNoTypeArguments())
@@ -2006,7 +1944,7 @@
                                       listener: handleSend(s, ))
                           ensureSemicolon())
                           listener: handleExpressionStatement(s, ;)
-                  notEofOrValue(}, s)
+                  notEofOrType(CLOSE_CURLY_BRACKET, s)
                   parseStatement(;)
                     parseStatementX(;)
                       parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -2019,7 +1957,6 @@
                                   parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                                     looksLikeFunctionBody(;)
                                     parseSend(;, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(;)
                                       ensureIdentifier(;, expression)
                                         listener: handleIdentifier(s, expression)
                                       listener: handleNoTypeArguments(()
@@ -2033,7 +1970,6 @@
                                                   parsePrimary((, expression, ConstantPatternContext.none)
                                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                       parseSend((, expression, ConstantPatternContext.none)
-                                                        isNextIdentifier(()
                                                         ensureIdentifier((, expression)
                                                           listener: handleIdentifier(x, expression)
                                                         listener: handleNoTypeArguments(&)
@@ -2046,7 +1982,6 @@
                                                     parsePrimary(&, expression, ConstantPatternContext.none)
                                                       parseSendOrFunctionLiteral(&, expression, ConstantPatternContext.none)
                                                         parseSend(&, expression, ConstantPatternContext.none)
-                                                          isNextIdentifier(&)
                                                           ensureIdentifier(&, expression)
                                                             listener: handleIdentifier(y, expression)
                                                           listener: handleNoTypeArguments(,)
@@ -2060,7 +1995,6 @@
                                                   parsePrimary(,, expression, ConstantPatternContext.none)
                                                     parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                                       parseSend(,, expression, ConstantPatternContext.none)
-                                                        isNextIdentifier(,)
                                                         ensureIdentifier(,, expression)
                                                           listener: handleIdentifier(x, expression)
                                                         listener: handleNoTypeArguments(&)
@@ -2073,7 +2007,6 @@
                                                     parsePrimary(&, expression, ConstantPatternContext.none)
                                                       parseSendOrFunctionLiteral(&, expression, ConstantPatternContext.none)
                                                         parseSend(&, expression, ConstantPatternContext.none)
-                                                          isNextIdentifier(&)
                                                           ensureIdentifier(&, expression)
                                                             listener: handleIdentifier(y, expression)
                                                           listener: handleNoTypeArguments())
@@ -2085,11 +2018,11 @@
                                       listener: handleSend(s, ))
                           ensureSemicolon())
                           listener: handleExpressionStatement(s, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, s, (, null, })
               listener: endMember()
-            notEofOrValue(}, Key)
+            notEofOrType(CLOSE_CURLY_BRACKET, Key)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Key)
               parseMetadataStar(})
                 listener: beginMetadataStar(Key)
@@ -2145,7 +2078,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(foo, expression)
                                     listener: handleNoTypeArguments(=)
@@ -2157,7 +2089,6 @@
                                 parsePrimary(=, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                     parseSend(=, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(=)
                                       ensureIdentifier(=, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments(and)
@@ -2170,7 +2101,6 @@
                                   parsePrimary(&, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(&, expression, ConstantPatternContext.none)
                                       parseSend(&, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(&)
                                         ensureIdentifier(&, expression)
                                         parseArgumentsOpt(y)
                               reportRecoverableError(and, Message[BinaryOperatorWrittenOut, Binary operator 'and' is written as '&' instead of the written out word., Try replacing 'and' with '&'., {string: and, string2: &}])
@@ -2182,7 +2112,6 @@
                                   parsePrimary(&, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(&, expression, ConstantPatternContext.none)
                                       parseSend(&, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(&)
                                         ensureIdentifier(&, expression)
                                           listener: handleIdentifier(y, expression)
                                         listener: handleNoTypeArguments(,)
@@ -2201,7 +2130,6 @@
                               parsePrimary(,, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                   parseSend(,, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(,)
                                     ensureIdentifier(,, expression)
                                       listener: handleIdentifier(bar, expression)
                                     listener: handleNoTypeArguments(=)
@@ -2213,7 +2141,6 @@
                                 parsePrimary(=, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                     parseSend(=, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(=)
                                       ensureIdentifier(=, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments(and)
@@ -2226,7 +2153,6 @@
                                   parsePrimary(&, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(&, expression, ConstantPatternContext.none)
                                       parseSend(&, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(&)
                                         ensureIdentifier(&, expression)
                                         parseArgumentsOpt(y)
                               reportRecoverableError(and, Message[BinaryOperatorWrittenOut, Binary operator 'and' is written as '&' instead of the written out word., Try replacing 'and' with '&'., {string: and, string2: &}])
@@ -2238,7 +2164,6 @@
                                   parsePrimary(&, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(&, expression, ConstantPatternContext.none)
                                       parseSend(&, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(&)
                                         ensureIdentifier(&, expression)
                                           listener: handleIdentifier(y, expression)
                                         listener: handleNoTypeArguments({)
@@ -2255,7 +2180,7 @@
                 inPlainSync()
                 parseFunctionBody(y, false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, print)
+                  notEofOrType(CLOSE_CURLY_BRACKET, print)
                   parseStatement({)
                     parseStatementX({)
                       parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -2268,7 +2193,6 @@
                                   parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                                     looksLikeFunctionBody(;)
                                     parseSend({, expression, ConstantPatternContext.none)
-                                      isNextIdentifier({)
                                       ensureIdentifier({, expression)
                                         listener: handleIdentifier(print, expression)
                                       listener: handleNoTypeArguments(()
@@ -2289,7 +2213,6 @@
                                                               parsePrimary(${, expression, ConstantPatternContext.none)
                                                                 parseSendOrFunctionLiteral(${, expression, ConstantPatternContext.none)
                                                                   parseSend(${, expression, ConstantPatternContext.none)
-                                                                    isNextIdentifier(${)
                                                                     ensureIdentifier(${, expression)
                                                                       listener: handleIdentifier(x, expression)
                                                                     listener: handleNoTypeArguments(and)
@@ -2302,7 +2225,6 @@
                                                                 parsePrimary(&, expression, ConstantPatternContext.none)
                                                                   parseSendOrFunctionLiteral(&, expression, ConstantPatternContext.none)
                                                                     parseSend(&, expression, ConstantPatternContext.none)
-                                                                      isNextIdentifier(&)
                                                                       ensureIdentifier(&, expression)
                                                                       parseArgumentsOpt(y)
                                                             reportRecoverableError(and, Message[BinaryOperatorWrittenOut, Binary operator 'and' is written as '&' instead of the written out word., Try replacing 'and' with '&'., {string: and, string2: &}])
@@ -2314,7 +2236,6 @@
                                                                 parsePrimary(&, expression, ConstantPatternContext.none)
                                                                   parseSendOrFunctionLiteral(&, expression, ConstantPatternContext.none)
                                                                     parseSend(&, expression, ConstantPatternContext.none)
-                                                                      isNextIdentifier(&)
                                                                       ensureIdentifier(&, expression)
                                                                         listener: handleIdentifier(y, expression)
                                                                       listener: handleNoTypeArguments(})
@@ -2330,11 +2251,11 @@
                                       listener: handleSend(print, ))
                           ensureSemicolon())
                           listener: handleExpressionStatement(print, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassConstructor(null, Key, (, :, })
               listener: endMember()
-            notEofOrValue(}, Key)
+            notEofOrType(CLOSE_CURLY_BRACKET, Key)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Key)
               parseMetadataStar(})
                 listener: beginMetadataStar(Key)
@@ -2390,7 +2311,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(foo, expression)
                                     listener: handleNoTypeArguments(=)
@@ -2402,7 +2322,6 @@
                                 parsePrimary(=, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                     parseSend(=, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(=)
                                       ensureIdentifier(=, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments(&)
@@ -2415,7 +2334,6 @@
                                   parsePrimary(&, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(&, expression, ConstantPatternContext.none)
                                       parseSend(&, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(&)
                                         ensureIdentifier(&, expression)
                                           listener: handleIdentifier(y, expression)
                                         listener: handleNoTypeArguments(,)
@@ -2434,7 +2352,6 @@
                               parsePrimary(,, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                   parseSend(,, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(,)
                                     ensureIdentifier(,, expression)
                                       listener: handleIdentifier(bar, expression)
                                     listener: handleNoTypeArguments(=)
@@ -2446,7 +2363,6 @@
                                 parsePrimary(=, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                     parseSend(=, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(=)
                                       ensureIdentifier(=, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments(&)
@@ -2459,7 +2375,6 @@
                                   parsePrimary(&, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(&, expression, ConstantPatternContext.none)
                                       parseSend(&, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(&)
                                         ensureIdentifier(&, expression)
                                           listener: handleIdentifier(y, expression)
                                         listener: handleNoTypeArguments({)
@@ -2476,7 +2391,7 @@
                 inPlainSync()
                 parseFunctionBody(y, false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, print)
+                  notEofOrType(CLOSE_CURLY_BRACKET, print)
                   parseStatement({)
                     parseStatementX({)
                       parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -2489,7 +2404,6 @@
                                   parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                                     looksLikeFunctionBody(;)
                                     parseSend({, expression, ConstantPatternContext.none)
-                                      isNextIdentifier({)
                                       ensureIdentifier({, expression)
                                         listener: handleIdentifier(print, expression)
                                       listener: handleNoTypeArguments(()
@@ -2510,7 +2424,6 @@
                                                               parsePrimary(${, expression, ConstantPatternContext.none)
                                                                 parseSendOrFunctionLiteral(${, expression, ConstantPatternContext.none)
                                                                   parseSend(${, expression, ConstantPatternContext.none)
-                                                                    isNextIdentifier(${)
                                                                     ensureIdentifier(${, expression)
                                                                       listener: handleIdentifier(x, expression)
                                                                     listener: handleNoTypeArguments(&)
@@ -2523,7 +2436,6 @@
                                                                 parsePrimary(&, expression, ConstantPatternContext.none)
                                                                   parseSendOrFunctionLiteral(&, expression, ConstantPatternContext.none)
                                                                     parseSend(&, expression, ConstantPatternContext.none)
-                                                                      isNextIdentifier(&)
                                                                       ensureIdentifier(&, expression)
                                                                         listener: handleIdentifier(y, expression)
                                                                       listener: handleNoTypeArguments(})
@@ -2539,11 +2451,11 @@
                                       listener: handleSend(print, ))
                           ensureSemicolon())
                           listener: handleExpressionStatement(print, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassConstructor(null, Key, (, :, })
               listener: endMember()
-            notEofOrValue(}, not_currently_working)
+            notEofOrType(CLOSE_CURLY_BRACKET, not_currently_working)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Key)
               parseMetadataStar(})
                 listener: beginMetadataStar(not_currently_working)
@@ -2595,7 +2507,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, x)
+                  notEofOrType(CLOSE_CURLY_BRACKET, x)
                   parseStatement({)
                     parseStatementX({)
                       parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -2619,7 +2531,7 @@
                               listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], and, and)
                             rewriter()
                           listener: endVariablesDeclaration(1, ;)
-                  notEofOrValue(}, y)
+                  notEofOrType(CLOSE_CURLY_BRACKET, y)
                   parseStatement(;)
                     parseStatementX(;)
                       parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -2631,7 +2543,6 @@
                                 parsePrimary(;, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                                     parseSend(;, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(;)
                                       ensureIdentifier(;, expression)
                                         listener: handleIdentifier(y, expression)
                                       listener: handleNoTypeArguments(;)
@@ -2640,7 +2551,7 @@
                                       listener: handleSend(y, y)
                           ensureSemicolon(y)
                           listener: handleExpressionStatement(y, ;)
-                  notEofOrValue(}, x)
+                  notEofOrType(CLOSE_CURLY_BRACKET, x)
                   parseStatement(;)
                     parseStatementX(;)
                       parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -2652,7 +2563,6 @@
                                 parsePrimary(;, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                                     parseSend(;, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(;)
                                       ensureIdentifier(;, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments(&)
@@ -2665,7 +2575,6 @@
                                   parsePrimary(&, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(&, expression, ConstantPatternContext.none)
                                       parseSend(&, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(&)
                                         ensureIdentifier(&, expression)
                                           listener: handleIdentifier(y, expression)
                                         listener: handleNoTypeArguments(;)
@@ -2675,11 +2584,11 @@
                               listener: endBinaryExpression(&, y)
                           ensureSemicolon(y)
                           listener: handleExpressionStatement(x, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(3, {, })
                 listener: endClassMethod(null, not_currently_working, (, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 22, {, })
           listener: endClassDeclaration(abstract, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_26810_or.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_26810_or.dart.intertwined.expect
index 8644c9a..c383a34 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_26810_or.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_26810_or.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(abstract, class, null)
           parseClassOrMixinOrExtensionBody(Key, DeclarationKind.Class, Key)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Key)
               parseMetadataStar({)
                 listener: beginMetadataStar(int)
@@ -57,7 +57,6 @@
                           parsePrimary(=>, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(=>, expression, ConstantPatternContext.none)
                               parseSend(=>, expression, ConstantPatternContext.none)
-                                isNextIdentifier(=>)
                                 ensureIdentifier(=>, expression)
                                   listener: handleIdentifier(runtimeType, expression)
                                 listener: handleNoTypeArguments(.)
@@ -67,7 +66,6 @@
                         parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                             parseSend(., expressionContinuation, ConstantPatternContext.none)
-                              isNextIdentifier(.)
                               ensureIdentifier(., expressionContinuation)
                                 listener: handleIdentifier(hashCode, expressionContinuation)
                               listener: handleNoTypeArguments(or)
@@ -83,7 +81,6 @@
                           parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                               parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                isNextIdentifier(.)
                                 ensureIdentifier(., expressionContinuation)
                                 parseArgumentsOpt(hashCode)
                         reportRecoverableError(or, Message[BinaryOperatorWrittenOut, Binary operator 'or' is written as '|' instead of the written out word., Try replacing 'or' with '|'., {string: or, string2: |}])
@@ -98,7 +95,6 @@
                           parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                               parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                isNextIdentifier(.)
                                 ensureIdentifier(., expressionContinuation)
                                   listener: handleIdentifier(hashCode, expressionContinuation)
                                 listener: handleNoTypeArguments(;)
@@ -112,7 +108,7 @@
                     inGenerator()
                 listener: endClassMethod(get, int, =>, null, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Key)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -144,7 +140,6 @@
                           parsePrimary(=>, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(=>, expression, ConstantPatternContext.none)
                               parseSend(=>, expression, ConstantPatternContext.none)
-                                isNextIdentifier(=>)
                                 ensureIdentifier(=>, expression)
                                   listener: handleIdentifier(runtimeType, expression)
                                 listener: handleNoTypeArguments(.)
@@ -154,7 +149,6 @@
                         parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                             parseSend(., expressionContinuation, ConstantPatternContext.none)
-                              isNextIdentifier(.)
                               ensureIdentifier(., expressionContinuation)
                                 listener: handleIdentifier(hashCode, expressionContinuation)
                               listener: handleNoTypeArguments(|)
@@ -171,7 +165,6 @@
                           parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                               parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                isNextIdentifier(.)
                                 ensureIdentifier(., expressionContinuation)
                                   listener: handleIdentifier(hashCode, expressionContinuation)
                                 listener: handleNoTypeArguments(;)
@@ -185,7 +178,7 @@
                     inGenerator()
                 listener: endClassMethod(get, int, =>, null, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Key)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -211,7 +204,7 @@
                 inPlainSync()
                 parseFunctionBody(c, false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement({)
                     parseStatementX({)
                       parseReturnStatement({)
@@ -222,7 +215,6 @@
                               parsePrimary(return, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       listener: handleIdentifier(runtimeType, expression)
                                     listener: handleNoTypeArguments(.)
@@ -232,7 +224,6 @@
                             parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                 parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                  isNextIdentifier(.)
                                   ensureIdentifier(., expressionContinuation)
                                     listener: handleIdentifier(hashCode, expressionContinuation)
                                   listener: handleNoTypeArguments(or)
@@ -248,7 +239,6 @@
                               parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                   parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                    isNextIdentifier(.)
                                     ensureIdentifier(., expressionContinuation)
                                     parseArgumentsOpt(hashCode)
                             reportRecoverableError(or, Message[BinaryOperatorWrittenOut, Binary operator 'or' is written as '|' instead of the written out word., Try replacing 'or' with '|'., {string: or, string2: |}])
@@ -263,7 +253,6 @@
                               parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                   parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                    isNextIdentifier(.)
                                     ensureIdentifier(., expressionContinuation)
                                       listener: handleIdentifier(hashCode, expressionContinuation)
                                     listener: handleNoTypeArguments(;)
@@ -275,11 +264,11 @@
                         ensureSemicolon(hashCode)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(get, int, {, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Key)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -305,7 +294,7 @@
                 inPlainSync()
                 parseFunctionBody(d, false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement({)
                     parseStatementX({)
                       parseReturnStatement({)
@@ -316,7 +305,6 @@
                               parsePrimary(return, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       listener: handleIdentifier(runtimeType, expression)
                                     listener: handleNoTypeArguments(.)
@@ -326,7 +314,6 @@
                             parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                 parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                  isNextIdentifier(.)
                                   ensureIdentifier(., expressionContinuation)
                                     listener: handleIdentifier(hashCode, expressionContinuation)
                                   listener: handleNoTypeArguments(|)
@@ -343,7 +330,6 @@
                               parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                   parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                    isNextIdentifier(.)
                                     ensureIdentifier(., expressionContinuation)
                                       listener: handleIdentifier(hashCode, expressionContinuation)
                                     listener: handleNoTypeArguments(;)
@@ -355,11 +341,11 @@
                         ensureSemicolon(hashCode)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(get, int, {, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Key)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -397,7 +383,6 @@
                             parsePrimary(+, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(+, expression, ConstantPatternContext.none)
                                 parseSend(+, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(+)
                                   ensureIdentifier(+, expression)
                                     listener: handleIdentifier(runtimeType, expression)
                                   listener: handleNoTypeArguments(.)
@@ -407,7 +392,6 @@
                           parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                               parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                isNextIdentifier(.)
                                 ensureIdentifier(., expressionContinuation)
                                   listener: handleIdentifier(hashCode, expressionContinuation)
                                 listener: handleNoTypeArguments(or)
@@ -426,7 +410,6 @@
                           parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                               parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                isNextIdentifier(.)
                                 ensureIdentifier(., expressionContinuation)
                                 parseArgumentsOpt(hashCode)
                           parsePrecedenceExpression(+, 14, true, ConstantPatternContext.none)
@@ -445,7 +428,6 @@
                           parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                               parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                isNextIdentifier(.)
                                 ensureIdentifier(., expressionContinuation)
                                   listener: handleIdentifier(hashCode, expressionContinuation)
                                 listener: handleNoTypeArguments(+)
@@ -466,7 +448,7 @@
                     inGenerator()
                 listener: endClassMethod(get, int, =>, null, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Key)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -504,7 +486,6 @@
                             parsePrimary(+, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(+, expression, ConstantPatternContext.none)
                                 parseSend(+, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(+)
                                   ensureIdentifier(+, expression)
                                     listener: handleIdentifier(runtimeType, expression)
                                   listener: handleNoTypeArguments(.)
@@ -514,7 +495,6 @@
                           parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                               parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                isNextIdentifier(.)
                                 ensureIdentifier(., expressionContinuation)
                                   listener: handleIdentifier(hashCode, expressionContinuation)
                                 listener: handleNoTypeArguments(|)
@@ -532,7 +512,6 @@
                           parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                               parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                isNextIdentifier(.)
                                 ensureIdentifier(., expressionContinuation)
                                   listener: handleIdentifier(hashCode, expressionContinuation)
                                 listener: handleNoTypeArguments(+)
@@ -553,7 +532,7 @@
                     inGenerator()
                 listener: endClassMethod(get, int, =>, null, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Key)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -579,7 +558,7 @@
                 inPlainSync()
                 parseFunctionBody(g, false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement({)
                     parseStatementX({)
                       parseReturnStatement({)
@@ -596,7 +575,6 @@
                                 parsePrimary(+, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(+, expression, ConstantPatternContext.none)
                                     parseSend(+, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(+)
                                       ensureIdentifier(+, expression)
                                         listener: handleIdentifier(runtimeType, expression)
                                       listener: handleNoTypeArguments(.)
@@ -606,7 +584,6 @@
                               parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                   parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                    isNextIdentifier(.)
                                     ensureIdentifier(., expressionContinuation)
                                       listener: handleIdentifier(hashCode, expressionContinuation)
                                     listener: handleNoTypeArguments(or)
@@ -625,7 +602,6 @@
                               parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                   parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                    isNextIdentifier(.)
                                     ensureIdentifier(., expressionContinuation)
                                     parseArgumentsOpt(hashCode)
                               parsePrecedenceExpression(+, 14, true, ConstantPatternContext.none)
@@ -644,7 +620,6 @@
                               parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                   parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                    isNextIdentifier(.)
                                     ensureIdentifier(., expressionContinuation)
                                       listener: handleIdentifier(hashCode, expressionContinuation)
                                     listener: handleNoTypeArguments(+)
@@ -663,11 +638,11 @@
                         ensureSemicolon(3)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(get, int, {, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Key)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -693,7 +668,7 @@
                 inPlainSync()
                 parseFunctionBody(h, false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement({)
                     parseStatementX({)
                       parseReturnStatement({)
@@ -710,7 +685,6 @@
                                 parsePrimary(+, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(+, expression, ConstantPatternContext.none)
                                     parseSend(+, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(+)
                                       ensureIdentifier(+, expression)
                                         listener: handleIdentifier(runtimeType, expression)
                                       listener: handleNoTypeArguments(.)
@@ -720,7 +694,6 @@
                               parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                   parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                    isNextIdentifier(.)
                                     ensureIdentifier(., expressionContinuation)
                                       listener: handleIdentifier(hashCode, expressionContinuation)
                                     listener: handleNoTypeArguments(|)
@@ -738,7 +711,6 @@
                               parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                   parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                    isNextIdentifier(.)
                                     ensureIdentifier(., expressionContinuation)
                                       listener: handleIdentifier(hashCode, expressionContinuation)
                                     listener: handleNoTypeArguments(+)
@@ -757,11 +729,11 @@
                         ensureSemicolon(3)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(get, int, {, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Key)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -820,7 +792,6 @@
                           parsePrimary(=>, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(=>, expression, ConstantPatternContext.none)
                               parseSend(=>, expression, ConstantPatternContext.none)
-                                isNextIdentifier(=>)
                                 ensureIdentifier(=>, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(or)
@@ -833,7 +804,6 @@
                             parsePrimary(|, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(|, expression, ConstantPatternContext.none)
                                 parseSend(|, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(|)
                                   ensureIdentifier(|, expression)
                                   parseArgumentsOpt(y)
                         reportRecoverableError(or, Message[BinaryOperatorWrittenOut, Binary operator 'or' is written as '|' instead of the written out word., Try replacing 'or' with '|'., {string: or, string2: |}])
@@ -845,7 +815,6 @@
                             parsePrimary(|, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(|, expression, ConstantPatternContext.none)
                                 parseSend(|, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(|)
                                   ensureIdentifier(|, expression)
                                     listener: handleIdentifier(y, expression)
                                   listener: handleNoTypeArguments(;)
@@ -858,7 +827,7 @@
                     inGenerator()
                 listener: endClassMethod(null, int, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Key)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -917,7 +886,6 @@
                           parsePrimary(=>, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(=>, expression, ConstantPatternContext.none)
                               parseSend(=>, expression, ConstantPatternContext.none)
-                                isNextIdentifier(=>)
                                 ensureIdentifier(=>, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(|)
@@ -930,7 +898,6 @@
                             parsePrimary(|, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(|, expression, ConstantPatternContext.none)
                                 parseSend(|, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(|)
                                   ensureIdentifier(|, expression)
                                     listener: handleIdentifier(y, expression)
                                   listener: handleNoTypeArguments(;)
@@ -943,7 +910,7 @@
                     inGenerator()
                 listener: endClassMethod(null, int, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Key)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -996,7 +963,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement({)
                     parseStatementX({)
                       parseReturnStatement({)
@@ -1007,7 +974,6 @@
                               parsePrimary(return, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(or)
@@ -1020,7 +986,6 @@
                                 parsePrimary(|, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(|, expression, ConstantPatternContext.none)
                                     parseSend(|, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(|)
                                       ensureIdentifier(|, expression)
                                       parseArgumentsOpt(y)
                             reportRecoverableError(or, Message[BinaryOperatorWrittenOut, Binary operator 'or' is written as '|' instead of the written out word., Try replacing 'or' with '|'., {string: or, string2: |}])
@@ -1032,7 +997,6 @@
                                 parsePrimary(|, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(|, expression, ConstantPatternContext.none)
                                     parseSend(|, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(|)
                                       ensureIdentifier(|, expression)
                                         listener: handleIdentifier(y, expression)
                                       listener: handleNoTypeArguments(;)
@@ -1043,11 +1007,11 @@
                         ensureSemicolon(y)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Key)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -1100,7 +1064,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement({)
                     parseStatementX({)
                       parseReturnStatement({)
@@ -1111,7 +1075,6 @@
                               parsePrimary(return, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(|)
@@ -1124,7 +1087,6 @@
                                 parsePrimary(|, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(|, expression, ConstantPatternContext.none)
                                     parseSend(|, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(|)
                                       ensureIdentifier(|, expression)
                                         listener: handleIdentifier(y, expression)
                                       listener: handleNoTypeArguments(;)
@@ -1135,11 +1097,11 @@
                         ensureSemicolon(y)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Key)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -1192,7 +1154,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, int)
+                  notEofOrType(CLOSE_CURLY_BRACKET, int)
                   parseStatement({)
                     parseStatementX({)
                       parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -1216,7 +1178,6 @@
                                     parsePrimary(=, expression, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                         parseSend(=, expression, ConstantPatternContext.none)
-                                          isNextIdentifier(=)
                                           ensureIdentifier(=, expression)
                                             listener: handleIdentifier(x, expression)
                                           listener: handleNoTypeArguments(or)
@@ -1229,7 +1190,6 @@
                                       parsePrimary(|, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral(|, expression, ConstantPatternContext.none)
                                           parseSend(|, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(|)
                                             ensureIdentifier(|, expression)
                                             parseArgumentsOpt(y)
                                   reportRecoverableError(or, Message[BinaryOperatorWrittenOut, Binary operator 'or' is written as '|' instead of the written out word., Try replacing 'or' with '|'., {string: or, string2: |}])
@@ -1241,7 +1201,6 @@
                                       parsePrimary(|, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral(|, expression, ConstantPatternContext.none)
                                           parseSend(|, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(|)
                                             ensureIdentifier(|, expression)
                                               listener: handleIdentifier(y, expression)
                                             listener: handleNoTypeArguments(;)
@@ -1253,7 +1212,7 @@
                             listener: endInitializedIdentifier(z)
                           ensureSemicolon(y)
                           listener: endVariablesDeclaration(1, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -1264,7 +1223,6 @@
                               parsePrimary(return, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       listener: handleIdentifier(z, expression)
                                     listener: handleNoTypeArguments(;)
@@ -1274,11 +1232,11 @@
                         ensureSemicolon(z)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Key)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -1331,7 +1289,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, int)
+                  notEofOrType(CLOSE_CURLY_BRACKET, int)
                   parseStatement({)
                     parseStatementX({)
                       parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -1355,7 +1313,6 @@
                                     parsePrimary(=, expression, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                         parseSend(=, expression, ConstantPatternContext.none)
-                                          isNextIdentifier(=)
                                           ensureIdentifier(=, expression)
                                             listener: handleIdentifier(x, expression)
                                           listener: handleNoTypeArguments(|)
@@ -1368,7 +1325,6 @@
                                       parsePrimary(|, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral(|, expression, ConstantPatternContext.none)
                                           parseSend(|, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(|)
                                             ensureIdentifier(|, expression)
                                               listener: handleIdentifier(y, expression)
                                             listener: handleNoTypeArguments(;)
@@ -1380,7 +1336,7 @@
                             listener: endInitializedIdentifier(z)
                           ensureSemicolon(y)
                           listener: endVariablesDeclaration(1, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -1391,7 +1347,6 @@
                               parsePrimary(return, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       listener: handleIdentifier(z, expression)
                                     listener: handleNoTypeArguments(;)
@@ -1401,11 +1356,11 @@
                         ensureSemicolon(z)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Key)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -1470,7 +1425,6 @@
                             parsePrimary(+, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(+, expression, ConstantPatternContext.none)
                                 parseSend(+, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(+)
                                   ensureIdentifier(+, expression)
                                     listener: handleIdentifier(x, expression)
                                   listener: handleNoTypeArguments(or)
@@ -1486,7 +1440,6 @@
                             parsePrimary(|, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(|, expression, ConstantPatternContext.none)
                                 parseSend(|, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(|)
                                   ensureIdentifier(|, expression)
                                   parseArgumentsOpt(y)
                           parsePrecedenceExpression(+, 14, true, ConstantPatternContext.none)
@@ -1502,7 +1455,6 @@
                             parsePrimary(|, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(|, expression, ConstantPatternContext.none)
                                 parseSend(|, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(|)
                                   ensureIdentifier(|, expression)
                                     listener: handleIdentifier(y, expression)
                                   listener: handleNoTypeArguments(+)
@@ -1522,7 +1474,7 @@
                     inGenerator()
                 listener: endClassMethod(null, int, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Key)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -1587,7 +1539,6 @@
                             parsePrimary(+, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(+, expression, ConstantPatternContext.none)
                                 parseSend(+, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(+)
                                   ensureIdentifier(+, expression)
                                     listener: handleIdentifier(x, expression)
                                   listener: handleNoTypeArguments(|)
@@ -1601,7 +1552,6 @@
                             parsePrimary(|, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(|, expression, ConstantPatternContext.none)
                                 parseSend(|, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(|)
                                   ensureIdentifier(|, expression)
                                     listener: handleIdentifier(y, expression)
                                   listener: handleNoTypeArguments(+)
@@ -1621,7 +1571,7 @@
                     inGenerator()
                 listener: endClassMethod(null, int, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Key)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -1674,7 +1624,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement({)
                     parseStatementX({)
                       parseReturnStatement({)
@@ -1691,7 +1641,6 @@
                                 parsePrimary(+, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(+, expression, ConstantPatternContext.none)
                                     parseSend(+, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(+)
                                       ensureIdentifier(+, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments(or)
@@ -1707,7 +1656,6 @@
                                 parsePrimary(|, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(|, expression, ConstantPatternContext.none)
                                     parseSend(|, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(|)
                                       ensureIdentifier(|, expression)
                                       parseArgumentsOpt(y)
                               parsePrecedenceExpression(+, 14, true, ConstantPatternContext.none)
@@ -1723,7 +1671,6 @@
                                 parsePrimary(|, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(|, expression, ConstantPatternContext.none)
                                     parseSend(|, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(|)
                                       ensureIdentifier(|, expression)
                                         listener: handleIdentifier(y, expression)
                                       listener: handleNoTypeArguments(+)
@@ -1741,11 +1688,11 @@
                         ensureSemicolon(3)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Key)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -1798,7 +1745,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement({)
                     parseStatementX({)
                       parseReturnStatement({)
@@ -1815,7 +1762,6 @@
                                 parsePrimary(+, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(+, expression, ConstantPatternContext.none)
                                     parseSend(+, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(+)
                                       ensureIdentifier(+, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments(|)
@@ -1829,7 +1775,6 @@
                                 parsePrimary(|, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(|, expression, ConstantPatternContext.none)
                                     parseSend(|, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(|)
                                       ensureIdentifier(|, expression)
                                         listener: handleIdentifier(y, expression)
                                       listener: handleNoTypeArguments(+)
@@ -1847,11 +1792,11 @@
                         ensureSemicolon(3)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, s)
+            notEofOrType(CLOSE_CURLY_BRACKET, s)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Key)
               parseMetadataStar(})
                 listener: beginMetadataStar(s)
@@ -1903,7 +1848,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, s)
+                  notEofOrType(CLOSE_CURLY_BRACKET, s)
                   parseStatement({)
                     parseStatementX({)
                       parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -1916,7 +1861,6 @@
                                   parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                                     looksLikeFunctionBody(;)
                                     parseSend({, expression, ConstantPatternContext.none)
-                                      isNextIdentifier({)
                                       ensureIdentifier({, expression)
                                         listener: handleIdentifier(s, expression)
                                       listener: handleNoTypeArguments(()
@@ -1930,7 +1874,6 @@
                                                   parsePrimary((, expression, ConstantPatternContext.none)
                                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                       parseSend((, expression, ConstantPatternContext.none)
-                                                        isNextIdentifier(()
                                                         ensureIdentifier((, expression)
                                                           listener: handleIdentifier(x, expression)
                                                         listener: handleNoTypeArguments(or)
@@ -1943,7 +1886,6 @@
                                                     parsePrimary(|, expression, ConstantPatternContext.none)
                                                       parseSendOrFunctionLiteral(|, expression, ConstantPatternContext.none)
                                                         parseSend(|, expression, ConstantPatternContext.none)
-                                                          isNextIdentifier(|)
                                                           ensureIdentifier(|, expression)
                                                           parseArgumentsOpt(y)
                                                 reportRecoverableError(or, Message[BinaryOperatorWrittenOut, Binary operator 'or' is written as '|' instead of the written out word., Try replacing 'or' with '|'., {string: or, string2: |}])
@@ -1955,7 +1897,6 @@
                                                     parsePrimary(|, expression, ConstantPatternContext.none)
                                                       parseSendOrFunctionLiteral(|, expression, ConstantPatternContext.none)
                                                         parseSend(|, expression, ConstantPatternContext.none)
-                                                          isNextIdentifier(|)
                                                           ensureIdentifier(|, expression)
                                                             listener: handleIdentifier(y, expression)
                                                           listener: handleNoTypeArguments(,)
@@ -1969,7 +1910,6 @@
                                                   parsePrimary(,, expression, ConstantPatternContext.none)
                                                     parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                                       parseSend(,, expression, ConstantPatternContext.none)
-                                                        isNextIdentifier(,)
                                                         ensureIdentifier(,, expression)
                                                           listener: handleIdentifier(x, expression)
                                                         listener: handleNoTypeArguments(or)
@@ -1982,7 +1922,6 @@
                                                     parsePrimary(|, expression, ConstantPatternContext.none)
                                                       parseSendOrFunctionLiteral(|, expression, ConstantPatternContext.none)
                                                         parseSend(|, expression, ConstantPatternContext.none)
-                                                          isNextIdentifier(|)
                                                           ensureIdentifier(|, expression)
                                                           parseArgumentsOpt(y)
                                                 reportRecoverableError(or, Message[BinaryOperatorWrittenOut, Binary operator 'or' is written as '|' instead of the written out word., Try replacing 'or' with '|'., {string: or, string2: |}])
@@ -1994,7 +1933,6 @@
                                                     parsePrimary(|, expression, ConstantPatternContext.none)
                                                       parseSendOrFunctionLiteral(|, expression, ConstantPatternContext.none)
                                                         parseSend(|, expression, ConstantPatternContext.none)
-                                                          isNextIdentifier(|)
                                                           ensureIdentifier(|, expression)
                                                             listener: handleIdentifier(y, expression)
                                                           listener: handleNoTypeArguments())
@@ -2006,7 +1944,7 @@
                                       listener: handleSend(s, ))
                           ensureSemicolon())
                           listener: handleExpressionStatement(s, ;)
-                  notEofOrValue(}, s)
+                  notEofOrType(CLOSE_CURLY_BRACKET, s)
                   parseStatement(;)
                     parseStatementX(;)
                       parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -2019,7 +1957,6 @@
                                   parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                                     looksLikeFunctionBody(;)
                                     parseSend(;, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(;)
                                       ensureIdentifier(;, expression)
                                         listener: handleIdentifier(s, expression)
                                       listener: handleNoTypeArguments(()
@@ -2033,7 +1970,6 @@
                                                   parsePrimary((, expression, ConstantPatternContext.none)
                                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                       parseSend((, expression, ConstantPatternContext.none)
-                                                        isNextIdentifier(()
                                                         ensureIdentifier((, expression)
                                                           listener: handleIdentifier(x, expression)
                                                         listener: handleNoTypeArguments(|)
@@ -2046,7 +1982,6 @@
                                                     parsePrimary(|, expression, ConstantPatternContext.none)
                                                       parseSendOrFunctionLiteral(|, expression, ConstantPatternContext.none)
                                                         parseSend(|, expression, ConstantPatternContext.none)
-                                                          isNextIdentifier(|)
                                                           ensureIdentifier(|, expression)
                                                             listener: handleIdentifier(y, expression)
                                                           listener: handleNoTypeArguments(,)
@@ -2060,7 +1995,6 @@
                                                   parsePrimary(,, expression, ConstantPatternContext.none)
                                                     parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                                       parseSend(,, expression, ConstantPatternContext.none)
-                                                        isNextIdentifier(,)
                                                         ensureIdentifier(,, expression)
                                                           listener: handleIdentifier(x, expression)
                                                         listener: handleNoTypeArguments(|)
@@ -2073,7 +2007,6 @@
                                                     parsePrimary(|, expression, ConstantPatternContext.none)
                                                       parseSendOrFunctionLiteral(|, expression, ConstantPatternContext.none)
                                                         parseSend(|, expression, ConstantPatternContext.none)
-                                                          isNextIdentifier(|)
                                                           ensureIdentifier(|, expression)
                                                             listener: handleIdentifier(y, expression)
                                                           listener: handleNoTypeArguments())
@@ -2085,11 +2018,11 @@
                                       listener: handleSend(s, ))
                           ensureSemicolon())
                           listener: handleExpressionStatement(s, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, s, (, null, })
               listener: endMember()
-            notEofOrValue(}, Key)
+            notEofOrType(CLOSE_CURLY_BRACKET, Key)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Key)
               parseMetadataStar(})
                 listener: beginMetadataStar(Key)
@@ -2145,7 +2078,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(foo, expression)
                                     listener: handleNoTypeArguments(=)
@@ -2157,7 +2089,6 @@
                                 parsePrimary(=, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                     parseSend(=, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(=)
                                       ensureIdentifier(=, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments(or)
@@ -2170,7 +2101,6 @@
                                   parsePrimary(|, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(|, expression, ConstantPatternContext.none)
                                       parseSend(|, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(|)
                                         ensureIdentifier(|, expression)
                                         parseArgumentsOpt(y)
                               reportRecoverableError(or, Message[BinaryOperatorWrittenOut, Binary operator 'or' is written as '|' instead of the written out word., Try replacing 'or' with '|'., {string: or, string2: |}])
@@ -2182,7 +2112,6 @@
                                   parsePrimary(|, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(|, expression, ConstantPatternContext.none)
                                       parseSend(|, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(|)
                                         ensureIdentifier(|, expression)
                                           listener: handleIdentifier(y, expression)
                                         listener: handleNoTypeArguments(,)
@@ -2201,7 +2130,6 @@
                               parsePrimary(,, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                   parseSend(,, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(,)
                                     ensureIdentifier(,, expression)
                                       listener: handleIdentifier(bar, expression)
                                     listener: handleNoTypeArguments(=)
@@ -2213,7 +2141,6 @@
                                 parsePrimary(=, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                     parseSend(=, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(=)
                                       ensureIdentifier(=, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments(or)
@@ -2226,7 +2153,6 @@
                                   parsePrimary(|, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(|, expression, ConstantPatternContext.none)
                                       parseSend(|, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(|)
                                         ensureIdentifier(|, expression)
                                         parseArgumentsOpt(y)
                               reportRecoverableError(or, Message[BinaryOperatorWrittenOut, Binary operator 'or' is written as '|' instead of the written out word., Try replacing 'or' with '|'., {string: or, string2: |}])
@@ -2238,7 +2164,6 @@
                                   parsePrimary(|, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(|, expression, ConstantPatternContext.none)
                                       parseSend(|, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(|)
                                         ensureIdentifier(|, expression)
                                           listener: handleIdentifier(y, expression)
                                         listener: handleNoTypeArguments({)
@@ -2255,7 +2180,7 @@
                 inPlainSync()
                 parseFunctionBody(y, false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, print)
+                  notEofOrType(CLOSE_CURLY_BRACKET, print)
                   parseStatement({)
                     parseStatementX({)
                       parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -2268,7 +2193,6 @@
                                   parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                                     looksLikeFunctionBody(;)
                                     parseSend({, expression, ConstantPatternContext.none)
-                                      isNextIdentifier({)
                                       ensureIdentifier({, expression)
                                         listener: handleIdentifier(print, expression)
                                       listener: handleNoTypeArguments(()
@@ -2289,7 +2213,6 @@
                                                               parsePrimary(${, expression, ConstantPatternContext.none)
                                                                 parseSendOrFunctionLiteral(${, expression, ConstantPatternContext.none)
                                                                   parseSend(${, expression, ConstantPatternContext.none)
-                                                                    isNextIdentifier(${)
                                                                     ensureIdentifier(${, expression)
                                                                       listener: handleIdentifier(x, expression)
                                                                     listener: handleNoTypeArguments(or)
@@ -2302,7 +2225,6 @@
                                                                 parsePrimary(|, expression, ConstantPatternContext.none)
                                                                   parseSendOrFunctionLiteral(|, expression, ConstantPatternContext.none)
                                                                     parseSend(|, expression, ConstantPatternContext.none)
-                                                                      isNextIdentifier(|)
                                                                       ensureIdentifier(|, expression)
                                                                       parseArgumentsOpt(y)
                                                             reportRecoverableError(or, Message[BinaryOperatorWrittenOut, Binary operator 'or' is written as '|' instead of the written out word., Try replacing 'or' with '|'., {string: or, string2: |}])
@@ -2314,7 +2236,6 @@
                                                                 parsePrimary(|, expression, ConstantPatternContext.none)
                                                                   parseSendOrFunctionLiteral(|, expression, ConstantPatternContext.none)
                                                                     parseSend(|, expression, ConstantPatternContext.none)
-                                                                      isNextIdentifier(|)
                                                                       ensureIdentifier(|, expression)
                                                                         listener: handleIdentifier(y, expression)
                                                                       listener: handleNoTypeArguments(})
@@ -2330,11 +2251,11 @@
                                       listener: handleSend(print, ))
                           ensureSemicolon())
                           listener: handleExpressionStatement(print, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassConstructor(null, Key, (, :, })
               listener: endMember()
-            notEofOrValue(}, Key)
+            notEofOrType(CLOSE_CURLY_BRACKET, Key)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Key)
               parseMetadataStar(})
                 listener: beginMetadataStar(Key)
@@ -2390,7 +2311,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(foo, expression)
                                     listener: handleNoTypeArguments(=)
@@ -2402,7 +2322,6 @@
                                 parsePrimary(=, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                     parseSend(=, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(=)
                                       ensureIdentifier(=, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments(|)
@@ -2415,7 +2334,6 @@
                                   parsePrimary(|, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(|, expression, ConstantPatternContext.none)
                                       parseSend(|, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(|)
                                         ensureIdentifier(|, expression)
                                           listener: handleIdentifier(y, expression)
                                         listener: handleNoTypeArguments(,)
@@ -2434,7 +2352,6 @@
                               parsePrimary(,, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                   parseSend(,, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(,)
                                     ensureIdentifier(,, expression)
                                       listener: handleIdentifier(bar, expression)
                                     listener: handleNoTypeArguments(=)
@@ -2446,7 +2363,6 @@
                                 parsePrimary(=, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                     parseSend(=, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(=)
                                       ensureIdentifier(=, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments(|)
@@ -2459,7 +2375,6 @@
                                   parsePrimary(|, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(|, expression, ConstantPatternContext.none)
                                       parseSend(|, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(|)
                                         ensureIdentifier(|, expression)
                                           listener: handleIdentifier(y, expression)
                                         listener: handleNoTypeArguments({)
@@ -2476,7 +2391,7 @@
                 inPlainSync()
                 parseFunctionBody(y, false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, print)
+                  notEofOrType(CLOSE_CURLY_BRACKET, print)
                   parseStatement({)
                     parseStatementX({)
                       parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -2489,7 +2404,6 @@
                                   parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                                     looksLikeFunctionBody(;)
                                     parseSend({, expression, ConstantPatternContext.none)
-                                      isNextIdentifier({)
                                       ensureIdentifier({, expression)
                                         listener: handleIdentifier(print, expression)
                                       listener: handleNoTypeArguments(()
@@ -2510,7 +2424,6 @@
                                                               parsePrimary(${, expression, ConstantPatternContext.none)
                                                                 parseSendOrFunctionLiteral(${, expression, ConstantPatternContext.none)
                                                                   parseSend(${, expression, ConstantPatternContext.none)
-                                                                    isNextIdentifier(${)
                                                                     ensureIdentifier(${, expression)
                                                                       listener: handleIdentifier(x, expression)
                                                                     listener: handleNoTypeArguments(|)
@@ -2523,7 +2436,6 @@
                                                                 parsePrimary(|, expression, ConstantPatternContext.none)
                                                                   parseSendOrFunctionLiteral(|, expression, ConstantPatternContext.none)
                                                                     parseSend(|, expression, ConstantPatternContext.none)
-                                                                      isNextIdentifier(|)
                                                                       ensureIdentifier(|, expression)
                                                                         listener: handleIdentifier(y, expression)
                                                                       listener: handleNoTypeArguments(})
@@ -2539,11 +2451,11 @@
                                       listener: handleSend(print, ))
                           ensureSemicolon())
                           listener: handleExpressionStatement(print, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassConstructor(null, Key, (, :, })
               listener: endMember()
-            notEofOrValue(}, not_currently_working)
+            notEofOrType(CLOSE_CURLY_BRACKET, not_currently_working)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Key)
               parseMetadataStar(})
                 listener: beginMetadataStar(not_currently_working)
@@ -2595,7 +2507,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, x)
+                  notEofOrType(CLOSE_CURLY_BRACKET, x)
                   parseStatement({)
                     parseStatementX({)
                       parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -2619,7 +2531,7 @@
                               listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], or, or)
                             rewriter()
                           listener: endVariablesDeclaration(1, ;)
-                  notEofOrValue(}, y)
+                  notEofOrType(CLOSE_CURLY_BRACKET, y)
                   parseStatement(;)
                     parseStatementX(;)
                       parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -2631,7 +2543,6 @@
                                 parsePrimary(;, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                                     parseSend(;, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(;)
                                       ensureIdentifier(;, expression)
                                         listener: handleIdentifier(y, expression)
                                       listener: handleNoTypeArguments(;)
@@ -2640,7 +2551,7 @@
                                       listener: handleSend(y, y)
                           ensureSemicolon(y)
                           listener: handleExpressionStatement(y, ;)
-                  notEofOrValue(}, x)
+                  notEofOrType(CLOSE_CURLY_BRACKET, x)
                   parseStatement(;)
                     parseStatementX(;)
                       parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -2652,7 +2563,6 @@
                                 parsePrimary(;, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                                     parseSend(;, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(;)
                                       ensureIdentifier(;, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments(|)
@@ -2665,7 +2575,6 @@
                                   parsePrimary(|, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(|, expression, ConstantPatternContext.none)
                                       parseSend(|, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(|)
                                         ensureIdentifier(|, expression)
                                           listener: handleIdentifier(y, expression)
                                         listener: handleNoTypeArguments(;)
@@ -2675,11 +2584,11 @@
                               listener: endBinaryExpression(|, y)
                           ensureSemicolon(y)
                           listener: handleExpressionStatement(x, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(3, {, })
                 listener: endClassMethod(null, not_currently_working, (, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 22, {, })
           listener: endClassDeclaration(abstract, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_38415.crash_dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_38415.crash_dart.intertwined.expect
index dc52dee..924169b 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_38415.crash_dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_38415.crash_dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, m)
+          notEofOrType(CLOSE_CURLY_BRACKET, m)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -39,7 +39,6 @@
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(})
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(m, expression)
                               listener: handleNoTypeArguments(()
@@ -53,7 +52,6 @@
                                           parsePrimary((, expression, ConstantPatternContext.none)
                                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                               parseSend((, expression, ConstantPatternContext.none)
-                                                isNextIdentifier(()
                                                 ensureIdentifier((, expression)
                                                   listener: handleIdentifier(T, expression)
                                                 listener: handleNoTypeArguments(<)
@@ -67,7 +65,6 @@
                                               parseSendOrFunctionLiteral(<, expression, ConstantPatternContext.none)
                                                 looksLikeFunctionBody(>)
                                                 parseSend(<, expression, ConstantPatternContext.none)
-                                                  isNextIdentifier(<)
                                                   ensureIdentifier(<, expression)
                                                     listener: handleIdentifier(R, expression)
                                                   listener: handleNoTypeArguments(()
@@ -106,7 +103,7 @@
                       listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], Z, Z)
                     rewriter()
                   listener: handleExpressionStatement(m, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(f, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_39026.crash_dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_39026.crash_dart.intertwined.expect
index 6d92eeb..de4eda3 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_39026.crash_dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_39026.crash_dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(A, DeclarationKind.Class, A)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, co)
+            notEofOrType(CLOSE_CURLY_BRACKET, co)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, A)
               parseMetadataStar({)
                 listener: beginMetadataStar(co)
@@ -60,11 +60,11 @@
                   inPlainSync()
                   parseFunctionBody(), false, true)
                     listener: beginBlockFunctionBody({)
-                    notEofOrValue(}, })
+                    notEofOrType(CLOSE_CURLY_BRACKET, })
                     listener: endBlockFunctionBody(0, {, })
                   listener: endClassMethod(null, co, (, null, })
                 listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_39026_prime.crash_dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_39026_prime.crash_dart.intertwined.expect
index 613d2cd..b8a8de6 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_39026_prime.crash_dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_39026_prime.crash_dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(A, DeclarationKind.Class, A)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, co)
+            notEofOrType(CLOSE_CURLY_BRACKET, co)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, A)
               parseMetadataStar({)
                 listener: beginMetadataStar(co)
@@ -56,11 +56,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassMethod(null, co, (, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_39058.crash_dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_39058.crash_dart.intertwined.expect
index de25c2c..2590745 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_39058.crash_dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_39058.crash_dart.intertwined.expect
@@ -14,7 +14,7 @@
         parseBlock(UnmatchedToken({), BlockKind(invalid))
           ensureBlock(UnmatchedToken({), BlockKind(invalid))
           listener: beginBlock({, BlockKind(invalid))
-          notEofOrValue(}, <)
+          notEofOrType(CLOSE_CURLY_BRACKET, <)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -44,7 +44,7 @@
                       reportRecoverableError((, Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}])
                       rewriter()
                     listener: handleExpressionStatement(<, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlock(1, {, }, BlockKind(invalid))
         listener: handleInvalidTopLevelBlock({)
       listener: handleInvalidTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_39058_prime.crash_dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_39058_prime.crash_dart.intertwined.expect
index c0e5d7e..012acc2 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_39058_prime.crash_dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_39058_prime.crash_dart.intertwined.expect
@@ -14,7 +14,7 @@
         parseBlock(, BlockKind(invalid))
           ensureBlock(, BlockKind(invalid))
           listener: beginBlock({, BlockKind(invalid))
-          notEofOrValue(}, <)
+          notEofOrType(CLOSE_CURLY_BRACKET, <)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -44,7 +44,7 @@
                       reportRecoverableError(>, Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}])
                       rewriter()
                     listener: handleExpressionStatement(<, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlock(1, {, }, BlockKind(invalid))
         listener: handleInvalidTopLevelBlock({)
       listener: handleInvalidTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_39060.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_39060.dart.intertwined.expect
index f190e28..3c95f4b 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_39060.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_39060.dart.intertwined.expect
@@ -26,13 +26,13 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, {)
+          notEofOrType(CLOSE_CURLY_BRACKET, {)
           parseStatement({)
             parseStatementX({)
               parseBlock({, BlockKind(statement))
                 ensureBlock({, BlockKind(statement))
                 listener: beginBlock({, BlockKind(statement))
-                notEofOrValue(}, s)
+                notEofOrType(CLOSE_CURLY_BRACKET, s)
                 parseStatement({)
                   parseStatementX({)
                     parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -56,7 +56,7 @@
                             listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], A, A)
                           rewriter()
                         listener: endVariablesDeclaration(1, ;)
-                notEofOrValue(}, <)
+                notEofOrType(CLOSE_CURLY_BRACKET, <)
                 parseStatement(;)
                   parseStatementX(;)
                     parseExpressionStatementOrDeclaration(;, null)
@@ -89,9 +89,9 @@
                               listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], >, >)
                             rewriter()
                           listener: handleExpressionStatement(<, ;)
-                notEofOrValue(}, })
+                notEofOrType(CLOSE_CURLY_BRACKET, })
                 listener: endBlock(2, {, }, BlockKind(statement))
-          notEofOrValue(}, )
+          notEofOrType(CLOSE_CURLY_BRACKET, )
           listener: endBlockFunctionBody(1, {, )
         listener: endTopLevelMethod(main, null, )
   listener: endTopLevelDeclaration()
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_39202.crash_dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_39202.crash_dart.intertwined.expect
index b43183b..dc76026 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_39202.crash_dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_39202.crash_dart.intertwined.expect
@@ -57,7 +57,6 @@
                   parsePrimary(=>, expression, ConstantPatternContext.none)
                     parseSendOrFunctionLiteral(=>, expression, ConstantPatternContext.none)
                       parseSend(=>, expression, ConstantPatternContext.none)
-                        isNextIdentifier(=>)
                         ensureIdentifier(=>, expression)
                           listener: handleIdentifier(a, expression)
                         listener: handleNoTypeArguments(b)
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_39230.crash_dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_39230.crash_dart.intertwined.expect
index 374dc7c..f697b04 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_39230.crash_dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_39230.crash_dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(C, DeclarationKind.Class, C)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, C)
+            notEofOrType(CLOSE_CURLY_BRACKET, C)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, C)
               parseMetadataStar({)
                 listener: beginMetadataStar(C)
@@ -61,7 +61,7 @@
                   listener: handleInvalidFunctionBody({)
                 listener: endClassConstructor(null, C, (, null, })
               listener: endMember()
-            notEofOrValue(}, /)
+            notEofOrType(CLOSE_CURLY_BRACKET, /)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, C)
               parseMetadataStar(})
                 listener: beginMetadataStar(/)
@@ -118,7 +118,7 @@
                       listener: handleRecoverableError(ConstructorWithWrongName, /, /)
                     listener: endClassConstructor(null, operator, (, :, ;)
                   listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 2, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_39958_01.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_39958_01.dart.intertwined.expect
index cf4bf51..d950390 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_39958_01.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_39958_01.dart.intertwined.expect
@@ -32,7 +32,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_39958_02.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_39958_02.dart.intertwined.expect
index 258c61c..3d9e18d 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_39958_02.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_39958_02.dart.intertwined.expect
@@ -31,7 +31,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(dynamic, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_39958_03.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_39958_03.dart.intertwined.expect
index 1dfa64e..dad7853 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_39958_03.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_39958_03.dart.intertwined.expect
@@ -31,7 +31,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_39958_04.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_39958_04.dart.intertwined.expect
index 8ca4165..396f5fc 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_39958_04.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_39958_04.dart.intertwined.expect
@@ -31,7 +31,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(Foo, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_41265.crash_dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_41265.crash_dart.intertwined.expect
index ddd71f0..d3f931c 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_41265.crash_dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_41265.crash_dart.intertwined.expect
@@ -33,7 +33,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(>, DeclarationKind.Class, A)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -64,7 +64,7 @@
           listener: handleMixinHeader(mixin)
         parseClassOrMixinOrExtensionBody(>, DeclarationKind.Mixin, M)
           listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Mixin, {)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endClassOrMixinOrExtensionBody(DeclarationKind.Mixin, 0, {, })
         listener: endMixinDeclaration(mixin, })
   listener: endTopLevelDeclaration(})
@@ -135,7 +135,7 @@
           ensureBlock(>, BlockKind(class declaration))
           parseClassOrMixinOrExtensionBody(>, DeclarationKind.Class, DND1)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_42229_prime_2.crash_dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_42229_prime_2.crash_dart.intertwined.expect
index 8061c7d..a9ea604 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_42229_prime_2.crash_dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_42229_prime_2.crash_dart.intertwined.expect
@@ -40,7 +40,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(Stream, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_42267.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_42267.dart.intertwined.expect
index a656e54..726c2c4 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_42267.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_42267.dart.intertwined.expect
@@ -25,7 +25,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, builder)
+          notEofOrType(CLOSE_CURLY_BRACKET, builder)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -37,7 +37,6 @@
                         parsePrimary({, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(builder, expression)
                               listener: handleNoTypeArguments(..)
@@ -47,7 +46,6 @@
                       parseCascadeExpression(builder)
                         listener: beginCascade(..)
                         parseSend(.., expressionContinuation, ConstantPatternContext.none)
-                          isNextIdentifier(..)
                           ensureIdentifier(.., expressionContinuation)
                             listener: handleIdentifier(foo, expressionContinuation)
                           listener: handleNoTypeArguments([)
@@ -62,7 +60,6 @@
                                 parsePrimary([, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                     parseSend([, expression, ConstantPatternContext.none)
-                                      isNextIdentifier([)
                                       ensureIdentifier([, expression)
                                         listener: handleIdentifier(bar, expression)
                                       listener: handleNoTypeArguments(])
@@ -74,7 +71,7 @@
                         listener: endCascade()
                   ensureSemicolon(])
                   listener: handleExpressionStatement(builder, ;)
-          notEofOrValue(}, FilterSet)
+          notEofOrType(CLOSE_CURLY_BRACKET, FilterSet)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -87,7 +84,6 @@
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(FilterSet, expression)
                               listener: handleNoTypeArguments(()
@@ -129,7 +125,6 @@
                                                             parsePrimary(=>, expression, ConstantPatternContext.none)
                                                               parseSendOrFunctionLiteral(=>, expression, ConstantPatternContext.none)
                                                                 parseSend(=>, expression, ConstantPatternContext.none)
-                                                                  isNextIdentifier(=>)
                                                                   ensureIdentifier(=>, expression)
                                                                     listener: handleIdentifier(builder, expression)
                                                                   listener: handleNoTypeArguments(..)
@@ -139,7 +134,6 @@
                                                           parseCascadeExpression(builder)
                                                             listener: beginCascade(..)
                                                             parseSend(.., expressionContinuation, ConstantPatternContext.none)
-                                                              isNextIdentifier(..)
                                                               ensureIdentifier(.., expressionContinuation)
                                                                 listener: handleIdentifier(foo, expressionContinuation)
                                                               listener: handleNoTypeArguments([)
@@ -154,7 +148,6 @@
                                                                     parsePrimary([, expression, ConstantPatternContext.none)
                                                                       parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                                                         parseSend([, expression, ConstantPatternContext.none)
-                                                                          isNextIdentifier([)
                                                                           ensureIdentifier([, expression)
                                                                             listener: handleIdentifier(bar, expression)
                                                                           listener: handleNoTypeArguments(])
@@ -171,7 +164,7 @@
                               listener: handleSend(FilterSet, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(FilterSet, ;)
-          notEofOrValue(}, builder)
+          notEofOrType(CLOSE_CURLY_BRACKET, builder)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -183,7 +176,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(builder, expression)
                               listener: handleNoTypeArguments(..)
@@ -193,7 +185,6 @@
                       parseCascadeExpression(builder)
                         listener: beginCascade(..)
                         parseSend(.., expressionContinuation, ConstantPatternContext.none)
-                          isNextIdentifier(..)
                           ensureIdentifier(.., expressionContinuation)
                             listener: handleIdentifier(foo, expressionContinuation)
                           listener: handleNoTypeArguments([])
@@ -210,7 +201,6 @@
                               parseUnaryExpression([, true, ConstantPatternContext.none)
                                 parsePrimary([, expression, ConstantPatternContext.none)
                                   parseSend([, expression, ConstantPatternContext.none)
-                                    isNextIdentifier([)
                                     ensureIdentifier([, expression)
                                       reportRecoverableErrorWithToken(], Template(ExpectedIdentifier))
                                         listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got ']'., Try inserting an identifier before ']'., {lexeme: ]}], ], ])
@@ -225,7 +215,7 @@
                         listener: endCascade()
                   ensureSemicolon(])
                   listener: handleExpressionStatement(builder, ;)
-          notEofOrValue(}, FilterSet)
+          notEofOrType(CLOSE_CURLY_BRACKET, FilterSet)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -238,7 +228,6 @@
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(FilterSet, expression)
                               listener: handleNoTypeArguments(()
@@ -280,7 +269,6 @@
                                                             parsePrimary(=>, expression, ConstantPatternContext.none)
                                                               parseSendOrFunctionLiteral(=>, expression, ConstantPatternContext.none)
                                                                 parseSend(=>, expression, ConstantPatternContext.none)
-                                                                  isNextIdentifier(=>)
                                                                   ensureIdentifier(=>, expression)
                                                                     listener: handleIdentifier(builder, expression)
                                                                   listener: handleNoTypeArguments(..)
@@ -290,7 +278,6 @@
                                                           parseCascadeExpression(builder)
                                                             listener: beginCascade(..)
                                                             parseSend(.., expressionContinuation, ConstantPatternContext.none)
-                                                              isNextIdentifier(..)
                                                               ensureIdentifier(.., expressionContinuation)
                                                                 listener: handleIdentifier(foo, expressionContinuation)
                                                               listener: handleNoTypeArguments([])
@@ -307,7 +294,6 @@
                                                                   parseUnaryExpression([, true, ConstantPatternContext.none)
                                                                     parsePrimary([, expression, ConstantPatternContext.none)
                                                                       parseSend([, expression, ConstantPatternContext.none)
-                                                                        isNextIdentifier([)
                                                                         ensureIdentifier([, expression)
                                                                           reportRecoverableErrorWithToken(], Template(ExpectedIdentifier))
                                                                             listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got ']'., Try inserting an identifier before ']'., {lexeme: ]}], ], ])
@@ -327,7 +313,7 @@
                               listener: handleSend(FilterSet, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(FilterSet, ;)
-          notEofOrValue(}, builder)
+          notEofOrType(CLOSE_CURLY_BRACKET, builder)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -339,7 +325,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(builder, expression)
                               listener: handleNoTypeArguments(..)
@@ -349,7 +334,6 @@
                       parseCascadeExpression(builder)
                         listener: beginCascade(..)
                         parseSend(.., expressionContinuation, ConstantPatternContext.none)
-                          isNextIdentifier(..)
                           ensureIdentifier(.., expressionContinuation)
                             listener: handleIdentifier(foo, expressionContinuation)
                           listener: handleNoTypeArguments([)
@@ -363,7 +347,6 @@
                               parseUnaryExpression([, true, ConstantPatternContext.none)
                                 parsePrimary([, expression, ConstantPatternContext.none)
                                   parseSend([, expression, ConstantPatternContext.none)
-                                    isNextIdentifier([)
                                     ensureIdentifier([, expression)
                                       reportRecoverableErrorWithToken(], Template(ExpectedIdentifier))
                                         listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got ']'., Try inserting an identifier before ']'., {lexeme: ]}], ], ])
@@ -378,7 +361,7 @@
                         listener: endCascade()
                   ensureSemicolon(])
                   listener: handleExpressionStatement(builder, ;)
-          notEofOrValue(}, FilterSet)
+          notEofOrType(CLOSE_CURLY_BRACKET, FilterSet)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -391,7 +374,6 @@
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(FilterSet, expression)
                               listener: handleNoTypeArguments(()
@@ -433,7 +415,6 @@
                                                             parsePrimary(=>, expression, ConstantPatternContext.none)
                                                               parseSendOrFunctionLiteral(=>, expression, ConstantPatternContext.none)
                                                                 parseSend(=>, expression, ConstantPatternContext.none)
-                                                                  isNextIdentifier(=>)
                                                                   ensureIdentifier(=>, expression)
                                                                     listener: handleIdentifier(builder, expression)
                                                                   listener: handleNoTypeArguments(..)
@@ -443,7 +424,6 @@
                                                           parseCascadeExpression(builder)
                                                             listener: beginCascade(..)
                                                             parseSend(.., expressionContinuation, ConstantPatternContext.none)
-                                                              isNextIdentifier(..)
                                                               ensureIdentifier(.., expressionContinuation)
                                                                 listener: handleIdentifier(foo, expressionContinuation)
                                                               listener: handleNoTypeArguments([)
@@ -457,7 +437,6 @@
                                                                   parseUnaryExpression([, true, ConstantPatternContext.none)
                                                                     parsePrimary([, expression, ConstantPatternContext.none)
                                                                       parseSend([, expression, ConstantPatternContext.none)
-                                                                        isNextIdentifier([)
                                                                         ensureIdentifier([, expression)
                                                                           reportRecoverableErrorWithToken(], Template(ExpectedIdentifier))
                                                                             listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got ']'., Try inserting an identifier before ']'., {lexeme: ]}], ], ])
@@ -477,7 +456,7 @@
                               listener: handleSend(FilterSet, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(FilterSet, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(6, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_44785.crash_dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_44785.crash_dart.intertwined.expect
index faf0de0..928e76b 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_44785.crash_dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_44785.crash_dart.intertwined.expect
@@ -50,7 +50,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -63,7 +63,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(a, expression)
                                 listener: handleNoTypeArguments(==)
@@ -82,7 +81,6 @@
                               parsePrimary(|, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(|, expression, ConstantPatternContext.none)
                                   parseSend(|, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(|)
                                     ensureIdentifier(|, expression)
                                     parseArgumentsOpt(b)
                           rewriter()
@@ -93,7 +91,6 @@
                             parsePrimary(||, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(||, expression, ConstantPatternContext.none)
                                 parseSend(||, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(||)
                                   ensureIdentifier(||, expression)
                                   parseArgumentsOpt(b)
                           parsePrecedenceExpression(==, 8, true, ConstantPatternContext.none)
@@ -109,7 +106,6 @@
                             parsePrimary(||, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(||, expression, ConstantPatternContext.none)
                                 parseSend(||, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(||)
                                   ensureIdentifier(||, expression)
                                     listener: handleIdentifier(b, expression)
                                   listener: handleNoTypeArguments(==)
@@ -132,7 +128,7 @@
                     parseBlock(), BlockKind(statement))
                       ensureBlock(), BlockKind(statement))
                       listener: beginBlock({, BlockKind(statement))
-                      notEofOrValue(}, return)
+                      notEofOrType(CLOSE_CURLY_BRACKET, return)
                       parseStatement({)
                         parseStatementX({)
                           parseReturnStatement({)
@@ -149,11 +145,11 @@
                               rewriter()
                             listener: endReturnStatement(true, return, ;)
                             inGenerator()
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlock(1, {, }, BlockKind(statement))
                 listener: endThenStatement({, })
                 listener: endIfStatement(if, null, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(foo, null, })
   listener: endTopLevelDeclaration(})
@@ -205,7 +201,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -218,7 +214,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(a, expression)
                                 listener: handleNoTypeArguments(==)
@@ -237,7 +232,6 @@
                               parsePrimary(&, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(&, expression, ConstantPatternContext.none)
                                   parseSend(&, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(&)
                                     ensureIdentifier(&, expression)
                                     parseArgumentsOpt(b)
                           rewriter()
@@ -248,7 +242,6 @@
                             parsePrimary(&&, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(&&, expression, ConstantPatternContext.none)
                                 parseSend(&&, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(&&)
                                   ensureIdentifier(&&, expression)
                                   parseArgumentsOpt(b)
                           parsePrecedenceExpression(==, 8, true, ConstantPatternContext.none)
@@ -264,7 +257,6 @@
                             parsePrimary(&&, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(&&, expression, ConstantPatternContext.none)
                                 parseSend(&&, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(&&)
                                   ensureIdentifier(&&, expression)
                                     listener: handleIdentifier(b, expression)
                                   listener: handleNoTypeArguments(==)
@@ -287,7 +279,7 @@
                     parseBlock(), BlockKind(statement))
                       ensureBlock(), BlockKind(statement))
                       listener: beginBlock({, BlockKind(statement))
-                      notEofOrValue(}, return)
+                      notEofOrType(CLOSE_CURLY_BRACKET, return)
                       parseStatement({)
                         parseStatementX({)
                           parseReturnStatement({)
@@ -304,11 +296,11 @@
                               rewriter()
                             listener: endReturnStatement(true, return, ;)
                             inGenerator()
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlock(1, {, }, BlockKind(statement))
                 listener: endThenStatement({, })
                 listener: endIfStatement(if, null, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(bar, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_44785_prime_1.crash_dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_44785_prime_1.crash_dart.intertwined.expect
index 021ce81..0ab66ac 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_44785_prime_1.crash_dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_44785_prime_1.crash_dart.intertwined.expect
@@ -50,7 +50,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -63,7 +63,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(a, expression)
                                 listener: handleNoTypeArguments(==)
@@ -82,7 +81,6 @@
                               parsePrimary(|, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(|, expression, ConstantPatternContext.none)
                                   parseSend(|, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(|)
                                     ensureIdentifier(|, expression)
                                     parseArgumentsOpt(b)
                           rewriter()
@@ -93,7 +91,6 @@
                             parsePrimary(||, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(||, expression, ConstantPatternContext.none)
                                 parseSend(||, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(||)
                                   ensureIdentifier(||, expression)
                                   parseArgumentsOpt(b)
                           parsePrecedenceExpression(==, 8, true, ConstantPatternContext.none)
@@ -109,7 +106,6 @@
                             parsePrimary(||, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(||, expression, ConstantPatternContext.none)
                                 parseSend(||, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(||)
                                   ensureIdentifier(||, expression)
                                     listener: handleIdentifier(b, expression)
                                   listener: handleNoTypeArguments(==)
@@ -132,7 +128,7 @@
                     parseBlock(), BlockKind(statement))
                       ensureBlock(), BlockKind(statement))
                       listener: beginBlock({, BlockKind(statement))
-                      notEofOrValue(}, return)
+                      notEofOrType(CLOSE_CURLY_BRACKET, return)
                       parseStatement({)
                         parseStatementX({)
                           parseReturnStatement({)
@@ -146,11 +142,11 @@
                             ensureSemicolon(null)
                             listener: endReturnStatement(true, return, ;)
                             inGenerator()
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlock(1, {, }, BlockKind(statement))
                 listener: endThenStatement({, })
                 listener: endIfStatement(if, null, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(foo, null, })
   listener: endTopLevelDeclaration(})
@@ -214,7 +210,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -227,7 +223,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(a, expression)
                                 listener: handleNoTypeArguments(==)
@@ -246,7 +241,6 @@
                               parsePrimary(|, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(|, expression, ConstantPatternContext.none)
                                   parseSend(|, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(|)
                                     ensureIdentifier(|, expression)
                                     parseArgumentsOpt(b)
                           rewriter()
@@ -257,7 +251,6 @@
                             parsePrimary(||, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(||, expression, ConstantPatternContext.none)
                                 parseSend(||, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(||)
                                   ensureIdentifier(||, expression)
                                   parseArgumentsOpt(b)
                           parsePrecedenceExpression(==, 8, true, ConstantPatternContext.none)
@@ -273,7 +266,6 @@
                             parsePrimary(||, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(||, expression, ConstantPatternContext.none)
                                 parseSend(||, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(||)
                                   ensureIdentifier(||, expression)
                                     listener: handleIdentifier(b, expression)
                                   listener: handleNoTypeArguments(==)
@@ -292,7 +284,6 @@
                                 parsePrimary(|, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(|, expression, ConstantPatternContext.none)
                                     parseSend(|, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(|)
                                       ensureIdentifier(|, expression)
                                       parseArgumentsOpt(c)
                             rewriter()
@@ -305,7 +296,6 @@
                             parsePrimary(||, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(||, expression, ConstantPatternContext.none)
                                 parseSend(||, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(||)
                                   ensureIdentifier(||, expression)
                                   parseArgumentsOpt(c)
                           parsePrecedenceExpression(==, 8, true, ConstantPatternContext.none)
@@ -321,7 +311,6 @@
                             parsePrimary(||, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(||, expression, ConstantPatternContext.none)
                                 parseSend(||, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(||)
                                   ensureIdentifier(||, expression)
                                     listener: handleIdentifier(c, expression)
                                   listener: handleNoTypeArguments(==)
@@ -344,7 +333,7 @@
                     parseBlock(), BlockKind(statement))
                       ensureBlock(), BlockKind(statement))
                       listener: beginBlock({, BlockKind(statement))
-                      notEofOrValue(}, return)
+                      notEofOrType(CLOSE_CURLY_BRACKET, return)
                       parseStatement({)
                         parseStatementX({)
                           parseReturnStatement({)
@@ -358,11 +347,11 @@
                             ensureSemicolon(null)
                             listener: endReturnStatement(true, return, ;)
                             inGenerator()
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlock(1, {, }, BlockKind(statement))
                 listener: endThenStatement({, })
                 listener: endIfStatement(if, null, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(foo2, null, })
   listener: endTopLevelDeclaration(})
@@ -414,7 +403,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -427,7 +416,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(a, expression)
                                 listener: handleNoTypeArguments(==)
@@ -446,7 +434,6 @@
                               parsePrimary(&, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(&, expression, ConstantPatternContext.none)
                                   parseSend(&, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(&)
                                     ensureIdentifier(&, expression)
                                     parseArgumentsOpt(b)
                           rewriter()
@@ -457,7 +444,6 @@
                             parsePrimary(&&, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(&&, expression, ConstantPatternContext.none)
                                 parseSend(&&, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(&&)
                                   ensureIdentifier(&&, expression)
                                   parseArgumentsOpt(b)
                           parsePrecedenceExpression(==, 8, true, ConstantPatternContext.none)
@@ -473,7 +459,6 @@
                             parsePrimary(&&, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(&&, expression, ConstantPatternContext.none)
                                 parseSend(&&, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(&&)
                                   ensureIdentifier(&&, expression)
                                     listener: handleIdentifier(b, expression)
                                   listener: handleNoTypeArguments(==)
@@ -496,7 +481,7 @@
                     parseBlock(), BlockKind(statement))
                       ensureBlock(), BlockKind(statement))
                       listener: beginBlock({, BlockKind(statement))
-                      notEofOrValue(}, return)
+                      notEofOrType(CLOSE_CURLY_BRACKET, return)
                       parseStatement({)
                         parseStatementX({)
                           parseReturnStatement({)
@@ -510,11 +495,11 @@
                             ensureSemicolon(null)
                             listener: endReturnStatement(true, return, ;)
                             inGenerator()
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlock(1, {, }, BlockKind(statement))
                 listener: endThenStatement({, })
                 listener: endIfStatement(if, null, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(bar, null, })
   listener: endTopLevelDeclaration(})
@@ -578,7 +563,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -591,7 +576,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(a, expression)
                                 listener: handleNoTypeArguments(==)
@@ -610,7 +594,6 @@
                               parsePrimary(&, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(&, expression, ConstantPatternContext.none)
                                   parseSend(&, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(&)
                                     ensureIdentifier(&, expression)
                                     parseArgumentsOpt(b)
                           rewriter()
@@ -621,7 +604,6 @@
                             parsePrimary(&&, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(&&, expression, ConstantPatternContext.none)
                                 parseSend(&&, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(&&)
                                   ensureIdentifier(&&, expression)
                                   parseArgumentsOpt(b)
                           parsePrecedenceExpression(==, 8, true, ConstantPatternContext.none)
@@ -637,7 +619,6 @@
                             parsePrimary(&&, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(&&, expression, ConstantPatternContext.none)
                                 parseSend(&&, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(&&)
                                   ensureIdentifier(&&, expression)
                                     listener: handleIdentifier(b, expression)
                                   listener: handleNoTypeArguments(==)
@@ -656,7 +637,6 @@
                                 parsePrimary(&, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(&, expression, ConstantPatternContext.none)
                                     parseSend(&, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(&)
                                       ensureIdentifier(&, expression)
                                       parseArgumentsOpt(c)
                             rewriter()
@@ -669,7 +649,6 @@
                             parsePrimary(&&, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(&&, expression, ConstantPatternContext.none)
                                 parseSend(&&, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(&&)
                                   ensureIdentifier(&&, expression)
                                   parseArgumentsOpt(c)
                           parsePrecedenceExpression(==, 8, true, ConstantPatternContext.none)
@@ -685,7 +664,6 @@
                             parsePrimary(&&, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(&&, expression, ConstantPatternContext.none)
                                 parseSend(&&, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(&&)
                                   ensureIdentifier(&&, expression)
                                     listener: handleIdentifier(c, expression)
                                   listener: handleNoTypeArguments(==)
@@ -708,7 +686,7 @@
                     parseBlock(), BlockKind(statement))
                       ensureBlock(), BlockKind(statement))
                       listener: beginBlock({, BlockKind(statement))
-                      notEofOrValue(}, return)
+                      notEofOrType(CLOSE_CURLY_BRACKET, return)
                       parseStatement({)
                         parseStatementX({)
                           parseReturnStatement({)
@@ -722,11 +700,11 @@
                             ensureSemicolon(null)
                             listener: endReturnStatement(true, return, ;)
                             inGenerator()
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlock(1, {, }, BlockKind(statement))
                 listener: endThenStatement({, })
                 listener: endIfStatement(if, null, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(bar2, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_44785_prime_2.crash_dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_44785_prime_2.crash_dart.intertwined.expect
index 156bfc3..2403c90 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_44785_prime_2.crash_dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_44785_prime_2.crash_dart.intertwined.expect
@@ -50,7 +50,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -63,7 +63,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(a, expression)
                                 listener: handleNoTypeArguments(==)
@@ -83,7 +82,6 @@
                             parsePrimary(||, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(||, expression, ConstantPatternContext.none)
                                 parseSend(||, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(||)
                                   ensureIdentifier(||, expression)
                                     listener: handleIdentifier(b, expression)
                                   listener: handleNoTypeArguments(==)
@@ -106,7 +104,7 @@
                     parseBlock(), BlockKind(statement))
                       ensureBlock(), BlockKind(statement))
                       listener: beginBlock({, BlockKind(statement))
-                      notEofOrValue(}, return)
+                      notEofOrType(CLOSE_CURLY_BRACKET, return)
                       parseStatement({)
                         parseStatementX({)
                           parseReturnStatement({)
@@ -120,11 +118,11 @@
                             ensureSemicolon(null)
                             listener: endReturnStatement(true, return, ;)
                             inGenerator()
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlock(1, {, }, BlockKind(statement))
                 listener: endThenStatement({, })
                 listener: endIfStatement(if, null, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(foo, null, })
   listener: endTopLevelDeclaration(})
@@ -188,7 +186,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -201,7 +199,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(a, expression)
                                 listener: handleNoTypeArguments(==)
@@ -221,7 +218,6 @@
                             parsePrimary(||, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(||, expression, ConstantPatternContext.none)
                                 parseSend(||, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(||)
                                   ensureIdentifier(||, expression)
                                     listener: handleIdentifier(b, expression)
                                   listener: handleNoTypeArguments(==)
@@ -242,7 +238,6 @@
                             parsePrimary(||, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(||, expression, ConstantPatternContext.none)
                                 parseSend(||, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(||)
                                   ensureIdentifier(||, expression)
                                     listener: handleIdentifier(c, expression)
                                   listener: handleNoTypeArguments(==)
@@ -265,7 +260,7 @@
                     parseBlock(), BlockKind(statement))
                       ensureBlock(), BlockKind(statement))
                       listener: beginBlock({, BlockKind(statement))
-                      notEofOrValue(}, return)
+                      notEofOrType(CLOSE_CURLY_BRACKET, return)
                       parseStatement({)
                         parseStatementX({)
                           parseReturnStatement({)
@@ -279,11 +274,11 @@
                             ensureSemicolon(null)
                             listener: endReturnStatement(true, return, ;)
                             inGenerator()
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlock(1, {, }, BlockKind(statement))
                 listener: endThenStatement({, })
                 listener: endIfStatement(if, null, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(foo2, null, })
   listener: endTopLevelDeclaration(})
@@ -335,7 +330,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -348,7 +343,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(a, expression)
                                 listener: handleNoTypeArguments(==)
@@ -368,7 +362,6 @@
                             parsePrimary(&&, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(&&, expression, ConstantPatternContext.none)
                                 parseSend(&&, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(&&)
                                   ensureIdentifier(&&, expression)
                                     listener: handleIdentifier(b, expression)
                                   listener: handleNoTypeArguments(==)
@@ -391,7 +384,7 @@
                     parseBlock(), BlockKind(statement))
                       ensureBlock(), BlockKind(statement))
                       listener: beginBlock({, BlockKind(statement))
-                      notEofOrValue(}, return)
+                      notEofOrType(CLOSE_CURLY_BRACKET, return)
                       parseStatement({)
                         parseStatementX({)
                           parseReturnStatement({)
@@ -405,11 +398,11 @@
                             ensureSemicolon(null)
                             listener: endReturnStatement(true, return, ;)
                             inGenerator()
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlock(1, {, }, BlockKind(statement))
                 listener: endThenStatement({, })
                 listener: endIfStatement(if, null, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(bar, null, })
   listener: endTopLevelDeclaration(})
@@ -473,7 +466,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -486,7 +479,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(a, expression)
                                 listener: handleNoTypeArguments(==)
@@ -506,7 +498,6 @@
                             parsePrimary(&&, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(&&, expression, ConstantPatternContext.none)
                                 parseSend(&&, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(&&)
                                   ensureIdentifier(&&, expression)
                                     listener: handleIdentifier(b, expression)
                                   listener: handleNoTypeArguments(==)
@@ -527,7 +518,6 @@
                             parsePrimary(&&, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(&&, expression, ConstantPatternContext.none)
                                 parseSend(&&, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(&&)
                                   ensureIdentifier(&&, expression)
                                     listener: handleIdentifier(c, expression)
                                   listener: handleNoTypeArguments(==)
@@ -550,7 +540,7 @@
                     parseBlock(), BlockKind(statement))
                       ensureBlock(), BlockKind(statement))
                       listener: beginBlock({, BlockKind(statement))
-                      notEofOrValue(}, return)
+                      notEofOrType(CLOSE_CURLY_BRACKET, return)
                       parseStatement({)
                         parseStatementX({)
                           parseReturnStatement({)
@@ -564,11 +554,11 @@
                             ensureSemicolon(null)
                             listener: endReturnStatement(true, return, ;)
                             inGenerator()
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlock(1, {, }, BlockKind(statement))
                 listener: endThenStatement({, })
                 listener: endIfStatement(if, null, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(bar2, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_45251.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_45251.dart.intertwined.expect
index 167b2b6..b4973d5 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_45251.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_45251.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(F, DeclarationKind.Class, F)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, F)
               parseMetadataStar({)
                 listener: beginMetadataStar(final)
@@ -56,7 +56,6 @@
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               reportRecoverableError(Map, Message[LiteralWithClass, A map literal can't be prefixed by 'Map'., Try removing 'Map', {string: map, lexeme: Map}])
                                 listener: handleRecoverableError(Message[LiteralWithClass, A map literal can't be prefixed by 'Map'., Try removing 'Map', {string: map, lexeme: Map}], Map, Map)
                               parsePrimary(Map, expression, ConstantPatternContext.none)
@@ -78,7 +77,7 @@
                   listener: endFieldInitializer(=, })
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -125,7 +124,7 @@
                   listener: endFieldInitializer(=, })
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -156,7 +155,6 @@
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               reportRecoverableError(Map, Message[LiteralWithClass, A map literal can't be prefixed by 'Map'., Try removing 'Map', {string: map, lexeme: Map}])
                                 listener: handleRecoverableError(Message[LiteralWithClass, A map literal can't be prefixed by 'Map'., Try removing 'Map', {string: map, lexeme: Map}], Map, Map)
                               parsePrimary(Map, expression, ConstantPatternContext.none)
@@ -166,7 +164,7 @@
                   listener: endFieldInitializer(=, })
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -198,7 +196,6 @@
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               ensureIdentifier(=, expression)
                                 listener: handleIdentifier(Map, expression)
                               listener: beginTypeArguments(<)
@@ -222,7 +219,7 @@
                   listener: endFieldInitializer(=, ))
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -254,7 +251,6 @@
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               ensureIdentifier(=, expression)
                                 listener: handleIdentifier(Map, expression)
                               listener: handleNoTypeArguments(()
@@ -267,7 +263,7 @@
                   listener: endFieldInitializer(=, ))
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -298,7 +294,6 @@
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               reportRecoverableError(Map, Message[LiteralWithClass, A map literal can't be prefixed by 'Map'., Try removing 'Map', {string: map, lexeme: Map}])
                                 listener: handleRecoverableError(Message[LiteralWithClass, A map literal can't be prefixed by 'Map'., Try removing 'Map', {string: map, lexeme: Map}], Map, Map)
                               parsePrimary(Map, expression, ConstantPatternContext.none)
@@ -335,7 +330,7 @@
                   listener: endFieldInitializer(=, })
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -366,7 +361,6 @@
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               reportRecoverableError(Map, Message[LiteralWithClass, A map literal can't be prefixed by 'Map'., Try removing 'Map', {string: map, lexeme: Map}])
                                 listener: handleRecoverableError(Message[LiteralWithClass, A map literal can't be prefixed by 'Map'., Try removing 'Map', {string: map, lexeme: Map}], Map, Map)
                               parsePrimary(Map, expression, ConstantPatternContext.none)
@@ -391,7 +385,7 @@
                   listener: endFieldInitializer(=, })
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -453,7 +447,7 @@
                   listener: endFieldInitializer(=, })
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -503,7 +497,7 @@
                   listener: endFieldInitializer(=, })
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 9, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_45251_const.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_45251_const.dart.intertwined.expect
index b501898..1c72b6e 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_45251_const.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_45251_const.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(F, DeclarationKind.Class, F)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, F)
               parseMetadataStar({)
                 listener: beginMetadataStar(final)
@@ -77,7 +77,7 @@
                   listener: endFieldInitializer(=, })
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -127,7 +127,7 @@
                   listener: endFieldInitializer(=, })
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -167,7 +167,7 @@
                   listener: endFieldInitializer(=, })
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -225,7 +225,7 @@
                   listener: endFieldInitializer(=, ))
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -272,7 +272,7 @@
                   listener: endFieldInitializer(=, ))
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -339,7 +339,7 @@
                   listener: endFieldInitializer(=, })
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -394,7 +394,7 @@
                   listener: endFieldInitializer(=, })
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -459,7 +459,7 @@
                   listener: endFieldInitializer(=, })
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -512,7 +512,7 @@
                   listener: endFieldInitializer(=, })
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 9, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_45251_list.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_45251_list.dart.intertwined.expect
index b77b596..ffb9c67 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_45251_list.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_45251_list.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(F, DeclarationKind.Class, F)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, F)
               parseMetadataStar({)
                 listener: beginMetadataStar(final)
@@ -52,7 +52,6 @@
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               reportRecoverableError(List, Message[LiteralWithClass, A list literal can't be prefixed by 'List'., Try removing 'List', {string: list, lexeme: List}])
                                 listener: handleRecoverableError(Message[LiteralWithClass, A list literal can't be prefixed by 'List'., Try removing 'List', {string: list, lexeme: List}], List, List)
                               parsePrimary(List, expression, ConstantPatternContext.none)
@@ -74,7 +73,7 @@
                   listener: endFieldInitializer(=, ])
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -117,7 +116,7 @@
                   listener: endFieldInitializer(=, ])
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -144,7 +143,6 @@
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               reportRecoverableError(List, Message[LiteralWithClass, A list literal can't be prefixed by 'List'., Try removing 'List', {string: list, lexeme: List}])
                                 listener: handleRecoverableError(Message[LiteralWithClass, A list literal can't be prefixed by 'List'., Try removing 'List', {string: list, lexeme: List}], List, List)
                               parsePrimary(List, expression, ConstantPatternContext.none)
@@ -157,7 +155,7 @@
                   listener: endFieldInitializer(=, ])
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -185,7 +183,6 @@
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               ensureIdentifier(=, expression)
                                 listener: handleIdentifier(List, expression)
                               listener: beginTypeArguments(<)
@@ -206,7 +203,7 @@
                   listener: endFieldInitializer(=, ))
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -234,7 +231,6 @@
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               ensureIdentifier(=, expression)
                                 listener: handleIdentifier(List, expression)
                               listener: handleNoTypeArguments(()
@@ -247,7 +243,7 @@
                   listener: endFieldInitializer(=, ))
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -274,7 +270,6 @@
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               reportRecoverableError(List, Message[LiteralWithClass, A list literal can't be prefixed by 'List'., Try removing 'List', {string: list, lexeme: List}])
                                 listener: handleRecoverableError(Message[LiteralWithClass, A list literal can't be prefixed by 'List'., Try removing 'List', {string: list, lexeme: List}], List, List)
                               parsePrimary(List, expression, ConstantPatternContext.none)
@@ -299,7 +294,7 @@
                   listener: endFieldInitializer(=, ])
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -326,7 +321,6 @@
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               ensureIdentifier(=, expression)
                                 listener: handleIdentifier(List, expression)
                               listener: handleNoTypeArguments([)
@@ -344,7 +338,7 @@
                   listener: endFieldInitializer(=, ])
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -390,7 +384,7 @@
                   listener: endFieldInitializer(=, ])
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -427,7 +421,7 @@
                   listener: endFieldInitializer(=, ])
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 9, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_45251_list_const.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_45251_list_const.dart.intertwined.expect
index 8aa9e36..ac76c60 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_45251_list_const.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_45251_list_const.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(F, DeclarationKind.Class, F)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, F)
               parseMetadataStar({)
                 listener: beginMetadataStar(final)
@@ -73,7 +73,7 @@
                   listener: endFieldInitializer(=, ])
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -119,7 +119,7 @@
                   listener: endFieldInitializer(=, ])
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -158,7 +158,7 @@
                   listener: endFieldInitializer(=, ])
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -209,7 +209,7 @@
                   listener: endFieldInitializer(=, ))
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -252,7 +252,7 @@
                   listener: endFieldInitializer(=, ))
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -303,7 +303,7 @@
                   listener: endFieldInitializer(=, ])
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -345,7 +345,7 @@
                   listener: endFieldInitializer(=, ])
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -394,7 +394,7 @@
                   listener: endFieldInitializer(=, ])
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -434,7 +434,7 @@
                   listener: endFieldInitializer(=, ])
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 9, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_45251_list_new.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_45251_list_new.dart.intertwined.expect
index 6763d34..e5332fc 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_45251_list_new.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_45251_list_new.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(F, DeclarationKind.Class, F)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, F)
               parseMetadataStar({)
                 listener: beginMetadataStar(final)
@@ -51,7 +51,6 @@
                       parseUnaryExpression(=, true, ConstantPatternContext.none)
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseNewExpression(=)
-                            isNextIdentifier(new)
                             reportRecoverableErrorWithEnd(new, List, Message[LiteralWithClassAndNew, A list literal can't be prefixed by 'new List'., Try removing 'new' and 'List', {string: list, lexeme: List}])
                               listener: handleRecoverableError(Message[LiteralWithClassAndNew, A list literal can't be prefixed by 'new List'., Try removing 'new' and 'List', {string: list, lexeme: List}], new, List)
                             parsePrimary(List, expression, ConstantPatternContext.none)
@@ -73,7 +72,7 @@
                   listener: endFieldInitializer(=, ])
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -99,7 +98,6 @@
                       parseUnaryExpression(=, true, ConstantPatternContext.none)
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseNewExpression(=)
-                            isNextIdentifier(new)
                             reportRecoverableError(new, LiteralWithNew)
                               listener: handleRecoverableError(LiteralWithNew, new, new)
                             parsePrimary(new, expression, ConstantPatternContext.none)
@@ -121,7 +119,7 @@
                   listener: endFieldInitializer(=, ])
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -147,7 +145,6 @@
                       parseUnaryExpression(=, true, ConstantPatternContext.none)
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseNewExpression(=)
-                            isNextIdentifier(new)
                             reportRecoverableErrorWithEnd(new, List, Message[LiteralWithClassAndNew, A list literal can't be prefixed by 'new List'., Try removing 'new' and 'List', {string: list, lexeme: List}])
                               listener: handleRecoverableError(Message[LiteralWithClassAndNew, A list literal can't be prefixed by 'new List'., Try removing 'new' and 'List', {string: list, lexeme: List}], new, List)
                             parsePrimary(List, expression, ConstantPatternContext.none)
@@ -160,7 +157,7 @@
                   listener: endFieldInitializer(=, ])
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -186,7 +183,6 @@
                       parseUnaryExpression(=, true, ConstantPatternContext.none)
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseNewExpression(=)
-                            isNextIdentifier(new)
                             listener: beginNewExpression(new)
                             parseConstructorReference(new, ConstructorReferenceContext.New, ComplexTypeParamOrArgInfo(start: <, inDeclaration: false, allowsVariance: false, typeArgumentCount: 1, skipEnd: >, recovered: false))
                               ensureIdentifier(new, constructorReference)
@@ -212,7 +208,7 @@
                   listener: endFieldInitializer(=, ))
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -238,7 +234,6 @@
                       parseUnaryExpression(=, true, ConstantPatternContext.none)
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseNewExpression(=)
-                            isNextIdentifier(new)
                             listener: beginNewExpression(new)
                             parseConstructorReference(new, ConstructorReferenceContext.New, NoTypeParamOrArg())
                               ensureIdentifier(new, constructorReference)
@@ -256,7 +251,7 @@
                   listener: endFieldInitializer(=, ))
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -282,7 +277,6 @@
                       parseUnaryExpression(=, true, ConstantPatternContext.none)
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseNewExpression(=)
-                            isNextIdentifier(new)
                             reportRecoverableErrorWithEnd(new, List, Message[LiteralWithClassAndNew, A list literal can't be prefixed by 'new List'., Try removing 'new' and 'List', {string: list, lexeme: List}])
                               listener: handleRecoverableError(Message[LiteralWithClassAndNew, A list literal can't be prefixed by 'new List'., Try removing 'new' and 'List', {string: list, lexeme: List}], new, List)
                             parsePrimary(List, expression, ConstantPatternContext.none)
@@ -307,7 +301,7 @@
                   listener: endFieldInitializer(=, ])
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -333,7 +327,6 @@
                       parseUnaryExpression(=, true, ConstantPatternContext.none)
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseNewExpression(=)
-                            isNextIdentifier(new)
                             reportRecoverableErrorWithEnd(new, List, Message[LiteralWithClassAndNew, A list literal can't be prefixed by 'new List'., Try removing 'new' and 'List', {string: list, lexeme: List}])
                               listener: handleRecoverableError(Message[LiteralWithClassAndNew, A list literal can't be prefixed by 'new List'., Try removing 'new' and 'List', {string: list, lexeme: List}], new, List)
                             parsePrimary(List, expression, ConstantPatternContext.none)
@@ -349,7 +342,7 @@
                   listener: endFieldInitializer(=, ])
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -375,7 +368,6 @@
                       parseUnaryExpression(=, true, ConstantPatternContext.none)
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseNewExpression(=)
-                            isNextIdentifier(new)
                             reportRecoverableError(new, LiteralWithNew)
                               listener: handleRecoverableError(LiteralWithNew, new, new)
                             parsePrimary(new, expression, ConstantPatternContext.none)
@@ -400,7 +392,7 @@
                   listener: endFieldInitializer(=, ])
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -426,7 +418,6 @@
                       parseUnaryExpression(=, true, ConstantPatternContext.none)
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseNewExpression(=)
-                            isNextIdentifier(new)
                             reportRecoverableError(new, LiteralWithNew)
                               listener: handleRecoverableError(LiteralWithNew, new, new)
                             parsePrimary(new, expression, ConstantPatternContext.none)
@@ -442,7 +433,7 @@
                   listener: endFieldInitializer(=, ])
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 9, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_45251_new.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_45251_new.dart.intertwined.expect
index a284668..48bd0fc 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_45251_new.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_45251_new.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(F, DeclarationKind.Class, F)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, F)
               parseMetadataStar({)
                 listener: beginMetadataStar(final)
@@ -55,7 +55,6 @@
                       parseUnaryExpression(=, true, ConstantPatternContext.none)
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseNewExpression(=)
-                            isNextIdentifier(new)
                             reportRecoverableErrorWithEnd(new, Map, Message[LiteralWithClassAndNew, A map literal can't be prefixed by 'new Map'., Try removing 'new' and 'Map', {string: map, lexeme: Map}])
                               listener: handleRecoverableError(Message[LiteralWithClassAndNew, A map literal can't be prefixed by 'new Map'., Try removing 'new' and 'Map', {string: map, lexeme: Map}], new, Map)
                             parsePrimary(Map, expression, ConstantPatternContext.none)
@@ -77,7 +76,7 @@
                   listener: endFieldInitializer(=, })
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -107,7 +106,6 @@
                       parseUnaryExpression(=, true, ConstantPatternContext.none)
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseNewExpression(=)
-                            isNextIdentifier(new)
                             reportRecoverableError(new, LiteralWithNew)
                               listener: handleRecoverableError(LiteralWithNew, new, new)
                             parsePrimary(new, expression, ConstantPatternContext.none)
@@ -129,7 +127,7 @@
                   listener: endFieldInitializer(=, })
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -159,7 +157,6 @@
                       parseUnaryExpression(=, true, ConstantPatternContext.none)
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseNewExpression(=)
-                            isNextIdentifier(new)
                             reportRecoverableErrorWithEnd(new, Map, Message[LiteralWithClassAndNew, A map literal can't be prefixed by 'new Map'., Try removing 'new' and 'Map', {string: map, lexeme: Map}])
                               listener: handleRecoverableError(Message[LiteralWithClassAndNew, A map literal can't be prefixed by 'new Map'., Try removing 'new' and 'Map', {string: map, lexeme: Map}], new, Map)
                             parsePrimary(Map, expression, ConstantPatternContext.none)
@@ -169,7 +166,7 @@
                   listener: endFieldInitializer(=, })
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -199,7 +196,6 @@
                       parseUnaryExpression(=, true, ConstantPatternContext.none)
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseNewExpression(=)
-                            isNextIdentifier(new)
                             listener: beginNewExpression(new)
                             parseConstructorReference(new, ConstructorReferenceContext.New, ComplexTypeParamOrArgInfo(start: <, inDeclaration: false, allowsVariance: false, typeArgumentCount: 2, skipEnd: >, recovered: false))
                               ensureIdentifier(new, constructorReference)
@@ -228,7 +224,7 @@
                   listener: endFieldInitializer(=, ))
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -258,7 +254,6 @@
                       parseUnaryExpression(=, true, ConstantPatternContext.none)
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseNewExpression(=)
-                            isNextIdentifier(new)
                             listener: beginNewExpression(new)
                             parseConstructorReference(new, ConstructorReferenceContext.New, NoTypeParamOrArg())
                               ensureIdentifier(new, constructorReference)
@@ -276,7 +271,7 @@
                   listener: endFieldInitializer(=, ))
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -306,7 +301,6 @@
                       parseUnaryExpression(=, true, ConstantPatternContext.none)
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseNewExpression(=)
-                            isNextIdentifier(new)
                             reportRecoverableErrorWithEnd(new, Map, Message[LiteralWithClassAndNew, A map literal can't be prefixed by 'new Map'., Try removing 'new' and 'Map', {string: map, lexeme: Map}])
                               listener: handleRecoverableError(Message[LiteralWithClassAndNew, A map literal can't be prefixed by 'new Map'., Try removing 'new' and 'Map', {string: map, lexeme: Map}], new, Map)
                             parsePrimary(Map, expression, ConstantPatternContext.none)
@@ -343,7 +337,7 @@
                   listener: endFieldInitializer(=, })
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -373,7 +367,6 @@
                       parseUnaryExpression(=, true, ConstantPatternContext.none)
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseNewExpression(=)
-                            isNextIdentifier(new)
                             reportRecoverableErrorWithEnd(new, Map, Message[LiteralWithClassAndNew, A map literal can't be prefixed by 'new Map'., Try removing 'new' and 'Map', {string: map, lexeme: Map}])
                               listener: handleRecoverableError(Message[LiteralWithClassAndNew, A map literal can't be prefixed by 'new Map'., Try removing 'new' and 'Map', {string: map, lexeme: Map}], new, Map)
                             parsePrimary(Map, expression, ConstantPatternContext.none)
@@ -398,7 +391,7 @@
                   listener: endFieldInitializer(=, })
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -428,7 +421,6 @@
                       parseUnaryExpression(=, true, ConstantPatternContext.none)
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseNewExpression(=)
-                            isNextIdentifier(new)
                             reportRecoverableError(new, LiteralWithNew)
                               listener: handleRecoverableError(LiteralWithNew, new, new)
                             parsePrimary(new, expression, ConstantPatternContext.none)
@@ -465,7 +457,7 @@
                   listener: endFieldInitializer(=, })
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -495,7 +487,6 @@
                       parseUnaryExpression(=, true, ConstantPatternContext.none)
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseNewExpression(=)
-                            isNextIdentifier(new)
                             reportRecoverableError(new, LiteralWithNew)
                               listener: handleRecoverableError(LiteralWithNew, new, new)
                             parsePrimary(new, expression, ConstantPatternContext.none)
@@ -520,7 +511,7 @@
                   listener: endFieldInitializer(=, })
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 9, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_45251_set.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_45251_set.dart.intertwined.expect
index 7d09a6e..5365e56 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_45251_set.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_45251_set.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(F, DeclarationKind.Class, F)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, F)
               parseMetadataStar({)
                 listener: beginMetadataStar(final)
@@ -52,7 +52,6 @@
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               reportRecoverableError(Set, Message[LiteralWithClass, A set literal can't be prefixed by 'Set'., Try removing 'Set', {string: set, lexeme: Set}])
                                 listener: handleRecoverableError(Message[LiteralWithClass, A set literal can't be prefixed by 'Set'., Try removing 'Set', {string: set, lexeme: Set}], Set, Set)
                               parsePrimary(Set, expression, ConstantPatternContext.none)
@@ -71,7 +70,7 @@
                   listener: endFieldInitializer(=, })
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -111,7 +110,7 @@
                   listener: endFieldInitializer(=, })
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -138,7 +137,6 @@
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               reportRecoverableError(Set, Message[LiteralWithClass, A set literal can't be prefixed by 'Set'., Try removing 'Set', {string: set, lexeme: Set}])
                                 listener: handleRecoverableError(Message[LiteralWithClass, A set literal can't be prefixed by 'Set'., Try removing 'Set', {string: set, lexeme: Set}], Set, Set)
                               parsePrimary(Set, expression, ConstantPatternContext.none)
@@ -148,7 +146,7 @@
                   listener: endFieldInitializer(=, })
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -176,7 +174,6 @@
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               ensureIdentifier(=, expression)
                                 listener: handleIdentifier(Set, expression)
                               listener: beginTypeArguments(<)
@@ -197,7 +194,7 @@
                   listener: endFieldInitializer(=, ))
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -225,7 +222,6 @@
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               ensureIdentifier(=, expression)
                                 listener: handleIdentifier(Set, expression)
                               listener: handleNoTypeArguments(()
@@ -238,7 +234,7 @@
                   listener: endFieldInitializer(=, ))
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -265,7 +261,6 @@
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               reportRecoverableError(Set, Message[LiteralWithClass, A set literal can't be prefixed by 'Set'., Try removing 'Set', {string: set, lexeme: Set}])
                                 listener: handleRecoverableError(Message[LiteralWithClass, A set literal can't be prefixed by 'Set'., Try removing 'Set', {string: set, lexeme: Set}], Set, Set)
                               parsePrimary(Set, expression, ConstantPatternContext.none)
@@ -290,7 +285,7 @@
                   listener: endFieldInitializer(=, })
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -317,7 +312,6 @@
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               reportRecoverableError(Set, Message[LiteralWithClass, A set literal can't be prefixed by 'Set'., Try removing 'Set', {string: set, lexeme: Set}])
                                 listener: handleRecoverableError(Message[LiteralWithClass, A set literal can't be prefixed by 'Set'., Try removing 'Set', {string: set, lexeme: Set}], Set, Set)
                               parsePrimary(Set, expression, ConstantPatternContext.none)
@@ -333,7 +327,7 @@
                   listener: endFieldInitializer(=, })
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -379,7 +373,7 @@
                   listener: endFieldInitializer(=, })
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -416,7 +410,7 @@
                   listener: endFieldInitializer(=, })
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 9, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_45251_set_const.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_45251_set_const.dart.intertwined.expect
index 626b796..b06913d 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_45251_set_const.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_45251_set_const.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(F, DeclarationKind.Class, F)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, F)
               parseMetadataStar({)
                 listener: beginMetadataStar(final)
@@ -70,7 +70,7 @@
                   listener: endFieldInitializer(=, })
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -113,7 +113,7 @@
                   listener: endFieldInitializer(=, })
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -149,7 +149,7 @@
                   listener: endFieldInitializer(=, })
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -200,7 +200,7 @@
                   listener: endFieldInitializer(=, ))
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -243,7 +243,7 @@
                   listener: endFieldInitializer(=, ))
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -294,7 +294,7 @@
                   listener: endFieldInitializer(=, })
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -336,7 +336,7 @@
                   listener: endFieldInitializer(=, })
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -385,7 +385,7 @@
                   listener: endFieldInitializer(=, })
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -425,7 +425,7 @@
                   listener: endFieldInitializer(=, })
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 9, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_45251_set_new.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_45251_set_new.dart.intertwined.expect
index 30fa3b7..4f4c02f 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_45251_set_new.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_45251_set_new.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(F, DeclarationKind.Class, F)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, F)
               parseMetadataStar({)
                 listener: beginMetadataStar(final)
@@ -51,7 +51,6 @@
                       parseUnaryExpression(=, true, ConstantPatternContext.none)
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseNewExpression(=)
-                            isNextIdentifier(new)
                             reportRecoverableErrorWithEnd(new, Set, Message[LiteralWithClassAndNew, A set literal can't be prefixed by 'new Set'., Try removing 'new' and 'Set', {string: set, lexeme: Set}])
                               listener: handleRecoverableError(Message[LiteralWithClassAndNew, A set literal can't be prefixed by 'new Set'., Try removing 'new' and 'Set', {string: set, lexeme: Set}], new, Set)
                             parsePrimary(Set, expression, ConstantPatternContext.none)
@@ -70,7 +69,7 @@
                   listener: endFieldInitializer(=, })
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -96,7 +95,6 @@
                       parseUnaryExpression(=, true, ConstantPatternContext.none)
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseNewExpression(=)
-                            isNextIdentifier(new)
                             reportRecoverableError(new, LiteralWithNew)
                               listener: handleRecoverableError(LiteralWithNew, new, new)
                             parsePrimary(new, expression, ConstantPatternContext.none)
@@ -115,7 +113,7 @@
                   listener: endFieldInitializer(=, })
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -141,7 +139,6 @@
                       parseUnaryExpression(=, true, ConstantPatternContext.none)
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseNewExpression(=)
-                            isNextIdentifier(new)
                             reportRecoverableErrorWithEnd(new, Set, Message[LiteralWithClassAndNew, A set literal can't be prefixed by 'new Set'., Try removing 'new' and 'Set', {string: set, lexeme: Set}])
                               listener: handleRecoverableError(Message[LiteralWithClassAndNew, A set literal can't be prefixed by 'new Set'., Try removing 'new' and 'Set', {string: set, lexeme: Set}], new, Set)
                             parsePrimary(Set, expression, ConstantPatternContext.none)
@@ -151,7 +148,7 @@
                   listener: endFieldInitializer(=, })
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -177,7 +174,6 @@
                       parseUnaryExpression(=, true, ConstantPatternContext.none)
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseNewExpression(=)
-                            isNextIdentifier(new)
                             listener: beginNewExpression(new)
                             parseConstructorReference(new, ConstructorReferenceContext.New, ComplexTypeParamOrArgInfo(start: <, inDeclaration: false, allowsVariance: false, typeArgumentCount: 1, skipEnd: >, recovered: false))
                               ensureIdentifier(new, constructorReference)
@@ -203,7 +199,7 @@
                   listener: endFieldInitializer(=, ))
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -229,7 +225,6 @@
                       parseUnaryExpression(=, true, ConstantPatternContext.none)
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseNewExpression(=)
-                            isNextIdentifier(new)
                             listener: beginNewExpression(new)
                             parseConstructorReference(new, ConstructorReferenceContext.New, NoTypeParamOrArg())
                               ensureIdentifier(new, constructorReference)
@@ -247,7 +242,7 @@
                   listener: endFieldInitializer(=, ))
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -273,7 +268,6 @@
                       parseUnaryExpression(=, true, ConstantPatternContext.none)
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseNewExpression(=)
-                            isNextIdentifier(new)
                             reportRecoverableErrorWithEnd(new, Set, Message[LiteralWithClassAndNew, A set literal can't be prefixed by 'new Set'., Try removing 'new' and 'Set', {string: set, lexeme: Set}])
                               listener: handleRecoverableError(Message[LiteralWithClassAndNew, A set literal can't be prefixed by 'new Set'., Try removing 'new' and 'Set', {string: set, lexeme: Set}], new, Set)
                             parsePrimary(Set, expression, ConstantPatternContext.none)
@@ -298,7 +292,7 @@
                   listener: endFieldInitializer(=, })
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -324,7 +318,6 @@
                       parseUnaryExpression(=, true, ConstantPatternContext.none)
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseNewExpression(=)
-                            isNextIdentifier(new)
                             reportRecoverableErrorWithEnd(new, Set, Message[LiteralWithClassAndNew, A set literal can't be prefixed by 'new Set'., Try removing 'new' and 'Set', {string: set, lexeme: Set}])
                               listener: handleRecoverableError(Message[LiteralWithClassAndNew, A set literal can't be prefixed by 'new Set'., Try removing 'new' and 'Set', {string: set, lexeme: Set}], new, Set)
                             parsePrimary(Set, expression, ConstantPatternContext.none)
@@ -340,7 +333,7 @@
                   listener: endFieldInitializer(=, })
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -366,7 +359,6 @@
                       parseUnaryExpression(=, true, ConstantPatternContext.none)
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseNewExpression(=)
-                            isNextIdentifier(new)
                             reportRecoverableError(new, LiteralWithNew)
                               listener: handleRecoverableError(LiteralWithNew, new, new)
                             parsePrimary(new, expression, ConstantPatternContext.none)
@@ -391,7 +383,7 @@
                   listener: endFieldInitializer(=, })
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, F)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -417,7 +409,6 @@
                       parseUnaryExpression(=, true, ConstantPatternContext.none)
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseNewExpression(=)
-                            isNextIdentifier(new)
                             reportRecoverableError(new, LiteralWithNew)
                               listener: handleRecoverableError(LiteralWithNew, new, new)
                             parsePrimary(new, expression, ConstantPatternContext.none)
@@ -433,7 +424,7 @@
                   listener: endFieldInitializer(=, })
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 9, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_45327.crash_dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_45327.crash_dart.intertwined.expect
index 82c4dc7..54f9d4d 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_45327.crash_dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_45327.crash_dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -39,7 +39,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(n, expression)
                                 listener: handleNoTypeArguments(is)
@@ -60,7 +59,6 @@
                           parseUnaryExpression(||, true, ConstantPatternContext.none)
                             parsePrimary(||, expression, ConstantPatternContext.none)
                               parseSend(||, expression, ConstantPatternContext.none)
-                                isNextIdentifier(||)
                                 ensureIdentifier(||, expression)
                                   reportRecoverableErrorWithToken(), Template(ExpectedIdentifier))
                                   rewriter()
@@ -80,7 +78,6 @@
                               parsePrimary(), expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(), expression, ConstantPatternContext.none)
                                   parseSend(), expression, ConstantPatternContext.none)
-                                    isNextIdentifier())
                                     ensureIdentifier(), expression)
                                       listener: handleIdentifier(or, expression)
                                     listener: handleNoTypeArguments(})
@@ -94,7 +91,7 @@
                         listener: handleExpressionStatement(or, ;)
                 listener: endThenStatement(or, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_45327_prime_1.crash_dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_45327_prime_1.crash_dart.intertwined.expect
index 3e8e0e4..28c2b9a 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_45327_prime_1.crash_dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_45327_prime_1.crash_dart.intertwined.expect
@@ -33,7 +33,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(>, DeclarationKind.Class, Foo)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, foo)
+            notEofOrType(CLOSE_CURLY_BRACKET, foo)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Foo)
               parseMetadataStar({)
                 listener: beginMetadataStar(foo)
@@ -73,7 +73,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -86,7 +86,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(key, expression)
                                         listener: handleNoTypeArguments(is)
@@ -107,7 +106,6 @@
                                   parseUnaryExpression(||, true, ConstantPatternContext.none)
                                     parsePrimary(||, expression, ConstantPatternContext.none)
                                       parseSend(||, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(||)
                                         ensureIdentifier(||, expression)
                                           reportRecoverableErrorWithToken(), Template(ExpectedIdentifier))
                                           rewriter()
@@ -127,7 +125,6 @@
                                       parsePrimary(), expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral(), expression, ConstantPatternContext.none)
                                           parseSend(), expression, ConstantPatternContext.none)
-                                            isNextIdentifier())
                                             ensureIdentifier(), expression)
                                               listener: handleIdentifier(or, expression)
                                             listener: handleNoTypeArguments(})
@@ -141,11 +138,11 @@
                                 listener: handleExpressionStatement(or, ;)
                         listener: endThenStatement(or, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(null, foo, (, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_45662.crash_dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_45662.crash_dart.intertwined.expect
index 2ecba26..bf44ab6 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_45662.crash_dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_45662.crash_dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(A, DeclarationKind.Class, A)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, List)
+            notEofOrType(CLOSE_CURLY_BRACKET, List)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, A)
               parseMetadataStar({)
                 listener: beginMetadataStar(List)
@@ -65,7 +65,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, List, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_45662_gt_gt.crash_dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_45662_gt_gt.crash_dart.intertwined.expect
index d5f9894..3acb012 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_45662_gt_gt.crash_dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_45662_gt_gt.crash_dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(A, DeclarationKind.Class, A)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, List)
+            notEofOrType(CLOSE_CURLY_BRACKET, List)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, A)
               parseMetadataStar({)
                 listener: beginMetadataStar(List)
@@ -60,7 +60,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, List, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_45662_gt_gt_prime.crash_dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_45662_gt_gt_prime.crash_dart.intertwined.expect
index 28949ab..3eedcb8 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_45662_gt_gt_prime.crash_dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_45662_gt_gt_prime.crash_dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(A, DeclarationKind.Class, A)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, List)
+            notEofOrType(CLOSE_CURLY_BRACKET, List)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, A)
               parseMetadataStar({)
                 listener: beginMetadataStar(List)
@@ -60,7 +60,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, List, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_45662_prime.crash_dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_45662_prime.crash_dart.intertwined.expect
index 24220fe..e91545018 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_45662_prime.crash_dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_45662_prime.crash_dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(A, DeclarationKind.Class, A)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, List)
+            notEofOrType(CLOSE_CURLY_BRACKET, List)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, A)
               parseMetadataStar({)
                 listener: beginMetadataStar(List)
@@ -65,7 +65,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, List, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_46346.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_46346.dart.intertwined.expect
index e27a535..acfc273 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_46346.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_46346.dart.intertwined.expect
@@ -27,7 +27,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(abstract, DeclarationKind.Class, abstract)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -56,7 +56,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(as, DeclarationKind.Class, as)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -85,7 +85,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(assert, DeclarationKind.Class, assert)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -112,7 +112,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(async, DeclarationKind.Class, async)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -139,7 +139,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(await, DeclarationKind.Class, await)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -168,7 +168,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(break, DeclarationKind.Class, break)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -197,7 +197,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(case, DeclarationKind.Class, case)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -226,7 +226,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(catch, DeclarationKind.Class, catch)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -255,7 +255,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(class, DeclarationKind.Class, class)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -284,7 +284,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(const, DeclarationKind.Class, const)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -313,7 +313,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(continue, DeclarationKind.Class, continue)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -342,7 +342,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(covariant, DeclarationKind.Class, covariant)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -371,7 +371,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(default, DeclarationKind.Class, default)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -400,7 +400,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(deferred, DeclarationKind.Class, deferred)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -429,7 +429,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(do, DeclarationKind.Class, do)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -458,7 +458,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(dynamic, DeclarationKind.Class, dynamic)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -487,7 +487,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(else, DeclarationKind.Class, else)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -516,7 +516,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(enum, DeclarationKind.Class, enum)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -545,7 +545,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(export, DeclarationKind.Class, export)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -574,7 +574,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(extends, DeclarationKind.Class, extends)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -603,7 +603,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(extension, DeclarationKind.Class, extension)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -632,7 +632,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(external, DeclarationKind.Class, external)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -661,7 +661,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(factory, DeclarationKind.Class, factory)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -690,7 +690,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(false, DeclarationKind.Class, false)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -719,7 +719,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(final, DeclarationKind.Class, final)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -748,7 +748,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(finally, DeclarationKind.Class, finally)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -777,7 +777,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(for, DeclarationKind.Class, for)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -806,7 +806,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Function, DeclarationKind.Class, Function)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -835,7 +835,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(get, DeclarationKind.Class, get)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -862,7 +862,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(hide, DeclarationKind.Class, hide)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -891,7 +891,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(if, DeclarationKind.Class, if)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -920,7 +920,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(implements, DeclarationKind.Class, implements)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -949,7 +949,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(import, DeclarationKind.Class, import)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -978,7 +978,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(in, DeclarationKind.Class, in)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -1005,7 +1005,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(inout, DeclarationKind.Class, inout)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -1034,7 +1034,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(interface, DeclarationKind.Class, interface)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -1063,7 +1063,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(is, DeclarationKind.Class, is)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -1092,7 +1092,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(late, DeclarationKind.Class, late)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -1121,7 +1121,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(library, DeclarationKind.Class, library)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -1150,7 +1150,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(mixin, DeclarationKind.Class, mixin)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -1177,7 +1177,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(native, DeclarationKind.Class, native)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -1206,7 +1206,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(new, DeclarationKind.Class, new)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -1235,7 +1235,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(null, DeclarationKind.Class, null)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -1262,7 +1262,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(of, DeclarationKind.Class, of)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -1289,7 +1289,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(on, DeclarationKind.Class, on)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -1318,7 +1318,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(operator, DeclarationKind.Class, operator)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -1345,7 +1345,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(out, DeclarationKind.Class, out)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -1374,7 +1374,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(part, DeclarationKind.Class, part)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -1401,7 +1401,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(patch, DeclarationKind.Class, patch)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -1430,7 +1430,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(required, DeclarationKind.Class, required)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -1459,7 +1459,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(rethrow, DeclarationKind.Class, rethrow)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -1488,7 +1488,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(return, DeclarationKind.Class, return)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -1517,7 +1517,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(set, DeclarationKind.Class, set)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -1544,7 +1544,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(show, DeclarationKind.Class, show)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -1571,7 +1571,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(source, DeclarationKind.Class, source)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -1600,7 +1600,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(static, DeclarationKind.Class, static)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -1629,7 +1629,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(super, DeclarationKind.Class, super)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -1658,7 +1658,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(switch, DeclarationKind.Class, switch)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -1685,7 +1685,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(sync, DeclarationKind.Class, sync)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -1714,7 +1714,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(this, DeclarationKind.Class, this)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -1743,7 +1743,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(throw, DeclarationKind.Class, throw)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -1772,7 +1772,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(true, DeclarationKind.Class, true)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -1801,7 +1801,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(try, DeclarationKind.Class, try)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -1830,7 +1830,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(typedef, DeclarationKind.Class, typedef)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -1859,7 +1859,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(var, DeclarationKind.Class, var)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -1888,7 +1888,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(void, DeclarationKind.Class, void)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -1917,7 +1917,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(while, DeclarationKind.Class, while)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -1946,7 +1946,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(with, DeclarationKind.Class, with)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -1973,7 +1973,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(yield, DeclarationKind.Class, yield)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_46346_prime_2.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_46346_prime_2.dart.intertwined.expect
index 13caf87..bd11271 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_46346_prime_2.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_46346_prime_2.dart.intertwined.expect
@@ -52,7 +52,7 @@
               rewriter()
           parseClassOrMixinOrExtensionBody(, DeclarationKind.Class, )
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
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 e60f37a..93fc74e 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
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(A, DeclarationKind.Class, A)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, Stream)
+            notEofOrType(CLOSE_CURLY_BRACKET, Stream)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, A)
               parseMetadataStar({)
                 listener: beginMetadataStar(Stream)
@@ -64,7 +64,7 @@
                     rewriter()
                   listener: endClassFields(null, null, null, null, null, null, null, 1, Stream, ;)
                 listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -91,7 +91,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(B, DeclarationKind.Class, B)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, List)
+            notEofOrType(CLOSE_CURLY_BRACKET, List)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, B)
               parseMetadataStar({)
                 listener: beginMetadataStar(List)
@@ -125,7 +125,7 @@
                     rewriter()
                   listener: endClassFields(null, null, null, null, null, null, null, 1, List, ;)
                 listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_1.crash_dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_1.crash_dart.intertwined.expect
index 34c61d4b..43b3556 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_1.crash_dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_1.crash_dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(A, DeclarationKind.Class, A)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, Stream)
+            notEofOrType(CLOSE_CURLY_BRACKET, Stream)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, A)
               parseMetadataStar({)
                 listener: beginMetadataStar(Stream)
@@ -67,11 +67,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassMethod(null, Stream, (, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_2.crash_dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_2.crash_dart.intertwined.expect
index 71bd39e..8e54033 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_2.crash_dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_46505_prime_2.crash_dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(A, DeclarationKind.Class, A)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, Stream)
+            notEofOrType(CLOSE_CURLY_BRACKET, Stream)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, A)
               parseMetadataStar({)
                 listener: beginMetadataStar(Stream)
@@ -63,11 +63,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassMethod(null, Stream, (, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
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 37ded1d..fa10f6a 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
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(A, DeclarationKind.Class, A)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, Stream)
+            notEofOrType(CLOSE_CURLY_BRACKET, Stream)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, A)
               parseMetadataStar({)
                 listener: beginMetadataStar(Stream)
@@ -69,7 +69,7 @@
                     rewriter()
                   listener: endClassFields(null, null, null, null, null, null, null, 1, Stream, ;)
                 listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
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 ecdfaa1..a6de89f 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
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(A, DeclarationKind.Class, A)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, Stream)
+            notEofOrType(CLOSE_CURLY_BRACKET, Stream)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, A)
               parseMetadataStar({)
                 listener: beginMetadataStar(Stream)
@@ -74,7 +74,7 @@
                     rewriter()
                   listener: endClassFields(null, null, null, null, null, null, null, 1, Stream, ;)
                 listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
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
index 774685d..0bfa855 100644
--- 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
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(A, DeclarationKind.Class, A)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, Stream)
+            notEofOrType(CLOSE_CURLY_BRACKET, Stream)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, A)
               parseMetadataStar({)
                 listener: beginMetadataStar(Stream)
@@ -74,7 +74,7 @@
                     rewriter()
                   listener: endClassFields(null, null, null, null, null, null, null, 1, Stream, ;)
                 listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -101,7 +101,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(B, DeclarationKind.Class, B)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, Stream)
+            notEofOrType(CLOSE_CURLY_BRACKET, Stream)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, B)
               parseMetadataStar({)
                 listener: beginMetadataStar(Stream)
@@ -138,7 +138,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, Stream, ;)
               listener: endMember()
-            notEofOrValue(}, Stream)
+            notEofOrType(CLOSE_CURLY_BRACKET, Stream)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, B)
               parseMetadataStar(;)
                 listener: beginMetadataStar(Stream)
@@ -187,7 +187,7 @@
                     rewriter()
                   listener: endClassFields(null, null, null, null, null, null, null, 1, Stream, ;)
                 listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 2, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -214,7 +214,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(C, DeclarationKind.Class, C)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, Stream)
+            notEofOrType(CLOSE_CURLY_BRACKET, Stream)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, C)
               parseMetadataStar({)
                 listener: beginMetadataStar(Stream)
@@ -251,7 +251,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, Stream, ;)
               listener: endMember()
-            notEofOrValue(}, Stream)
+            notEofOrType(CLOSE_CURLY_BRACKET, Stream)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, C)
               parseMetadataStar(;)
                 listener: beginMetadataStar(Stream)
@@ -334,7 +334,7 @@
                   listener: handleInvalidFunctionBody({)
                 listener: endClassMethod(null, Stream, (, null, })
               listener: endMember()
-            notEofOrValue(}, baz)
+            notEofOrType(CLOSE_CURLY_BRACKET, baz)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, C)
               parseMetadataStar(})
                 listener: beginMetadataStar(baz)
@@ -352,7 +352,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, baz, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 3, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
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
index 5b560d3..5ce41ca 100644
--- 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
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(A, DeclarationKind.Class, A)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, stream)
+            notEofOrType(CLOSE_CURLY_BRACKET, stream)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, A)
               parseMetadataStar({)
                 listener: beginMetadataStar(stream)
@@ -81,11 +81,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassMethod(null, stream, (, null, })
               listener: endMember()
-            notEofOrValue(}, stream2)
+            notEofOrType(CLOSE_CURLY_BRACKET, stream2)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, A)
               parseMetadataStar(})
                 listener: beginMetadataStar(stream2)
@@ -145,11 +145,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassMethod(null, stream2, (, null, })
               listener: endMember()
-            notEofOrValue(}, stream3)
+            notEofOrType(CLOSE_CURLY_BRACKET, stream3)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, A)
               parseMetadataStar(})
                 listener: beginMetadataStar(stream3)
@@ -197,11 +197,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassMethod(null, stream3, (, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 3, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_46736.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_46736.dart.intertwined.expect
index 8f1f32e..ae54f1b 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_46736.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_46736.dart.intertwined.expect
@@ -39,7 +39,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_46736_prime.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_46736_prime.dart.intertwined.expect
index c010cc8..5878c31 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_46736_prime.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_46736_prime.dart.intertwined.expect
@@ -37,7 +37,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_48288.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_48288.dart.intertwined.expect
index 43d30c3..41724e5 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_48288.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_48288.dart.intertwined.expect
@@ -37,7 +37,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, g)
+          notEofOrType(CLOSE_CURLY_BRACKET, g)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -50,7 +50,6 @@
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(g, expression)
                               listener: handleNoTypeArguments(()
@@ -84,7 +83,7 @@
                               listener: handleSend(g, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(g, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_48288_prime.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_48288_prime.dart.intertwined.expect
index 9a5a8ae..4d06bdd 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_48288_prime.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_48288_prime.dart.intertwined.expect
@@ -37,7 +37,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, g)
+          notEofOrType(CLOSE_CURLY_BRACKET, g)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -50,7 +50,6 @@
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(g, expression)
                               listener: handleNoTypeArguments(()
@@ -80,7 +79,7 @@
                               listener: handleSend(g, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(g, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_48371_prime1.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_48371_prime1.dart.intertwined.expect
index a5f94e9..789e534 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_48371_prime1.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_48371_prime1.dart.intertwined.expect
@@ -42,7 +42,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_48371_prime2.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_48371_prime2.dart.intertwined.expect
index e2ad029..7ed0834 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_48371_prime2.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_48371_prime2.dart.intertwined.expect
@@ -53,7 +53,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_48371_prime3.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_48371_prime3.dart.intertwined.expect
index 7e9aa00..aa71963 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_48371_prime3.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_48371_prime3.dart.intertwined.expect
@@ -61,7 +61,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(A, DeclarationKind.Class, A)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, A)
               parseMetadataStar({)
                 listener: beginMetadataStar(void)
@@ -100,7 +100,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, print)
+                  notEofOrType(CLOSE_CURLY_BRACKET, print)
                   parseStatement({)
                     parseStatementX({)
                       parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -113,7 +113,6 @@
                                   parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                                     looksLikeFunctionBody(;)
                                     parseSend({, expression, ConstantPatternContext.none)
-                                      isNextIdentifier({)
                                       ensureIdentifier({, expression)
                                         listener: handleIdentifier(print, expression)
                                       listener: handleNoTypeArguments(()
@@ -127,7 +126,6 @@
                                                   parsePrimary((, expression, ConstantPatternContext.none)
                                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                       parseSend((, expression, ConstantPatternContext.none)
-                                                        isNextIdentifier(()
                                                         ensureIdentifier((, expression)
                                                           listener: handleIdentifier(x, expression)
                                                         listener: handleNoTypeArguments(*)
@@ -145,11 +143,11 @@
                                       listener: handleSend(print, ))
                           ensureSemicolon())
                           listener: handleExpressionStatement(print, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(null, void, (, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -210,7 +208,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_48371_prime4.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_48371_prime4.dart.intertwined.expect
index d615969..99e8a52 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_48371_prime4.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_48371_prime4.dart.intertwined.expect
@@ -424,7 +424,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_48380_1.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_48380_1.dart.intertwined.expect
index 803466f..7e5ea69 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_48380_1.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_48380_1.dart.intertwined.expect
@@ -56,7 +56,7 @@
               listener: endArguments(0, (, ))
           listener: handleEnumElement({, null)
         listener: handleEnumElements(;, 1)
-        notEofOrValue(}, const)
+        notEofOrType(CLOSE_CURLY_BRACKET, const)
         parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Enum, E)
           parseMetadataStar(;)
             listener: beginMetadataStar(const)
@@ -87,7 +87,7 @@
               listener: handleEmptyFunctionBody(;)
             listener: endEnumConstructor(null, const, (, null, ;)
           listener: endMember()
-        notEofOrValue(}, const)
+        notEofOrType(CLOSE_CURLY_BRACKET, const)
         parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Enum, E)
           parseMetadataStar(;)
             listener: beginMetadataStar(const)
@@ -122,7 +122,7 @@
               listener: handleEmptyFunctionBody(;)
             listener: endEnumConstructor(null, const, (, null, ;)
           listener: endMember()
-        notEofOrValue(}, })
+        notEofOrType(CLOSE_CURLY_BRACKET, })
         listener: endEnum(enum, enum, {, 2, })
   listener: endTopLevelDeclaration(})
   reportAllErrorTokens(enum)
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_48380_1_comma.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_48380_1_comma.dart.intertwined.expect
index ded6c04..5fb32ee 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_48380_1_comma.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_48380_1_comma.dart.intertwined.expect
@@ -77,7 +77,7 @@
               listener: endArguments(0, (, ))
           listener: handleEnumElement(,, null)
         listener: handleEnumElements(;, 2)
-        notEofOrValue(}, const)
+        notEofOrType(CLOSE_CURLY_BRACKET, const)
         parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Enum, E)
           parseMetadataStar(;)
             listener: beginMetadataStar(const)
@@ -108,7 +108,7 @@
               listener: handleEmptyFunctionBody(;)
             listener: endEnumConstructor(null, const, (, null, ;)
           listener: endMember()
-        notEofOrValue(}, const)
+        notEofOrType(CLOSE_CURLY_BRACKET, const)
         parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Enum, E)
           parseMetadataStar(;)
             listener: beginMetadataStar(const)
@@ -143,7 +143,7 @@
               listener: handleEmptyFunctionBody(;)
             listener: endEnumConstructor(null, const, (, null, ;)
           listener: endMember()
-        notEofOrValue(}, })
+        notEofOrType(CLOSE_CURLY_BRACKET, })
         listener: endEnum(enum, enum, {, 2, })
   listener: endTopLevelDeclaration(})
   reportAllErrorTokens(enum)
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_48380_1_comma_ok.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_48380_1_comma_ok.dart.intertwined.expect
index 0a2ee63..34e561d 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_48380_1_comma_ok.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_48380_1_comma_ok.dart.intertwined.expect
@@ -70,7 +70,7 @@
               listener: endArguments(0, (, ))
           listener: handleEnumElement(,, null)
         listener: handleEnumElements(;, 2)
-        notEofOrValue(}, const)
+        notEofOrType(CLOSE_CURLY_BRACKET, const)
         parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Enum, E)
           parseMetadataStar(;)
             listener: beginMetadataStar(const)
@@ -101,7 +101,7 @@
               listener: handleEmptyFunctionBody(;)
             listener: endEnumConstructor(null, const, (, null, ;)
           listener: endMember()
-        notEofOrValue(}, const)
+        notEofOrType(CLOSE_CURLY_BRACKET, const)
         parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Enum, E)
           parseMetadataStar(;)
             listener: beginMetadataStar(const)
@@ -136,7 +136,7 @@
               listener: handleEmptyFunctionBody(;)
             listener: endEnumConstructor(null, const, (, null, ;)
           listener: endMember()
-        notEofOrValue(}, })
+        notEofOrType(CLOSE_CURLY_BRACKET, })
         listener: endEnum(enum, enum, {, 2, })
   listener: endTopLevelDeclaration(})
   reportAllErrorTokens(enum)
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_48380_1_ok.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_48380_1_ok.dart.intertwined.expect
index f0b8002..f9a965c 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_48380_1_ok.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_48380_1_ok.dart.intertwined.expect
@@ -49,7 +49,7 @@
               listener: endArguments(0, (, ))
           listener: handleEnumElement({, null)
         listener: handleEnumElements(;, 1)
-        notEofOrValue(}, const)
+        notEofOrType(CLOSE_CURLY_BRACKET, const)
         parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Enum, E)
           parseMetadataStar(;)
             listener: beginMetadataStar(const)
@@ -80,7 +80,7 @@
               listener: handleEmptyFunctionBody(;)
             listener: endEnumConstructor(null, const, (, null, ;)
           listener: endMember()
-        notEofOrValue(}, const)
+        notEofOrType(CLOSE_CURLY_BRACKET, const)
         parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Enum, E)
           parseMetadataStar(;)
             listener: beginMetadataStar(const)
@@ -115,7 +115,7 @@
               listener: handleEmptyFunctionBody(;)
             listener: endEnumConstructor(null, const, (, null, ;)
           listener: endMember()
-        notEofOrValue(}, })
+        notEofOrType(CLOSE_CURLY_BRACKET, })
         listener: endEnum(enum, enum, {, 2, })
   listener: endTopLevelDeclaration(})
   reportAllErrorTokens(enum)
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_48380_2.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_48380_2.dart.intertwined.expect
index 647c2c9..6d038d6 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_48380_2.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_48380_2.dart.intertwined.expect
@@ -51,7 +51,7 @@
               listener: endArguments(0, (, ))
           listener: handleEnumElement({, null)
         listener: handleEnumElements(;, 1)
-        notEofOrValue(}, const)
+        notEofOrType(CLOSE_CURLY_BRACKET, const)
         parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Enum, E)
           parseMetadataStar(;)
             listener: beginMetadataStar(const)
@@ -82,7 +82,7 @@
               listener: handleEmptyFunctionBody(;)
             listener: endEnumConstructor(null, const, (, null, ;)
           listener: endMember()
-        notEofOrValue(}, const)
+        notEofOrType(CLOSE_CURLY_BRACKET, const)
         parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Enum, E)
           parseMetadataStar(;)
             listener: beginMetadataStar(const)
@@ -117,7 +117,7 @@
               listener: handleEmptyFunctionBody(;)
             listener: endEnumConstructor(null, const, (, null, ;)
           listener: endMember()
-        notEofOrValue(}, })
+        notEofOrType(CLOSE_CURLY_BRACKET, })
         listener: endEnum(enum, enum, {, 2, })
   listener: endTopLevelDeclaration(})
   reportAllErrorTokens(enum)
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_48380_2_comma.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_48380_2_comma.dart.intertwined.expect
index 6dadee2..5de344d 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_48380_2_comma.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_48380_2_comma.dart.intertwined.expect
@@ -72,7 +72,7 @@
               listener: endArguments(0, (, ))
           listener: handleEnumElement(,, null)
         listener: handleEnumElements(;, 2)
-        notEofOrValue(}, const)
+        notEofOrType(CLOSE_CURLY_BRACKET, const)
         parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Enum, E)
           parseMetadataStar(;)
             listener: beginMetadataStar(const)
@@ -103,7 +103,7 @@
               listener: handleEmptyFunctionBody(;)
             listener: endEnumConstructor(null, const, (, null, ;)
           listener: endMember()
-        notEofOrValue(}, const)
+        notEofOrType(CLOSE_CURLY_BRACKET, const)
         parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Enum, E)
           parseMetadataStar(;)
             listener: beginMetadataStar(const)
@@ -138,7 +138,7 @@
               listener: handleEmptyFunctionBody(;)
             listener: endEnumConstructor(null, const, (, null, ;)
           listener: endMember()
-        notEofOrValue(}, })
+        notEofOrType(CLOSE_CURLY_BRACKET, })
         listener: endEnum(enum, enum, {, 2, })
   listener: endTopLevelDeclaration(})
   reportAllErrorTokens(enum)
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_48380_2_comma_ok.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_48380_2_comma_ok.dart.intertwined.expect
index 90f7256..cdf4ad4 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_48380_2_comma_ok.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_48380_2_comma_ok.dart.intertwined.expect
@@ -69,7 +69,7 @@
               listener: endArguments(0, (, ))
           listener: handleEnumElement(,, null)
         listener: handleEnumElements(;, 2)
-        notEofOrValue(}, const)
+        notEofOrType(CLOSE_CURLY_BRACKET, const)
         parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Enum, E)
           parseMetadataStar(;)
             listener: beginMetadataStar(const)
@@ -100,7 +100,7 @@
               listener: handleEmptyFunctionBody(;)
             listener: endEnumConstructor(null, const, (, null, ;)
           listener: endMember()
-        notEofOrValue(}, const)
+        notEofOrType(CLOSE_CURLY_BRACKET, const)
         parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Enum, E)
           parseMetadataStar(;)
             listener: beginMetadataStar(const)
@@ -135,7 +135,7 @@
               listener: handleEmptyFunctionBody(;)
             listener: endEnumConstructor(null, const, (, null, ;)
           listener: endMember()
-        notEofOrValue(}, })
+        notEofOrType(CLOSE_CURLY_BRACKET, })
         listener: endEnum(enum, enum, {, 2, })
   listener: endTopLevelDeclaration(})
   reportAllErrorTokens(enum)
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_48380_2_ok.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_48380_2_ok.dart.intertwined.expect
index 2224738..f5611ae 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_48380_2_ok.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_48380_2_ok.dart.intertwined.expect
@@ -48,7 +48,7 @@
               listener: endArguments(0, (, ))
           listener: handleEnumElement({, null)
         listener: handleEnumElements(;, 1)
-        notEofOrValue(}, const)
+        notEofOrType(CLOSE_CURLY_BRACKET, const)
         parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Enum, E)
           parseMetadataStar(;)
             listener: beginMetadataStar(const)
@@ -79,7 +79,7 @@
               listener: handleEmptyFunctionBody(;)
             listener: endEnumConstructor(null, const, (, null, ;)
           listener: endMember()
-        notEofOrValue(}, const)
+        notEofOrType(CLOSE_CURLY_BRACKET, const)
         parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Enum, E)
           parseMetadataStar(;)
             listener: beginMetadataStar(const)
@@ -114,7 +114,7 @@
               listener: handleEmptyFunctionBody(;)
             listener: endEnumConstructor(null, const, (, null, ;)
           listener: endMember()
-        notEofOrValue(}, })
+        notEofOrType(CLOSE_CURLY_BRACKET, })
         listener: endEnum(enum, enum, {, 2, })
   listener: endTopLevelDeclaration(})
   reportAllErrorTokens(enum)
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_48380_3.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_48380_3.dart.intertwined.expect
index e9724c7..e2d6900 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_48380_3.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_48380_3.dart.intertwined.expect
@@ -44,7 +44,7 @@
               listener: endArguments(0, (, ))
           listener: handleEnumElement({, null)
         listener: handleEnumElements(;, 1)
-        notEofOrValue(}, const)
+        notEofOrType(CLOSE_CURLY_BRACKET, const)
         parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Enum, E)
           parseMetadataStar(;)
             listener: beginMetadataStar(const)
@@ -75,7 +75,7 @@
               listener: handleEmptyFunctionBody(;)
             listener: endEnumConstructor(null, const, (, null, ;)
           listener: endMember()
-        notEofOrValue(}, const)
+        notEofOrType(CLOSE_CURLY_BRACKET, const)
         parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Enum, E)
           parseMetadataStar(;)
             listener: beginMetadataStar(const)
@@ -110,7 +110,7 @@
               listener: handleEmptyFunctionBody(;)
             listener: endEnumConstructor(null, const, (, null, ;)
           listener: endMember()
-        notEofOrValue(}, })
+        notEofOrType(CLOSE_CURLY_BRACKET, })
         listener: endEnum(enum, enum, {, 2, })
   listener: endTopLevelDeclaration(})
   reportAllErrorTokens(enum)
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_48380_3_comma.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_48380_3_comma.dart.intertwined.expect
index 11e9336..aec9633 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_48380_3_comma.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_48380_3_comma.dart.intertwined.expect
@@ -61,7 +61,7 @@
               listener: endArguments(0, (, ))
           listener: handleEnumElement(,, null)
         listener: handleEnumElements(;, 2)
-        notEofOrValue(}, const)
+        notEofOrType(CLOSE_CURLY_BRACKET, const)
         parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Enum, E)
           parseMetadataStar(;)
             listener: beginMetadataStar(const)
@@ -92,7 +92,7 @@
               listener: handleEmptyFunctionBody(;)
             listener: endEnumConstructor(null, const, (, null, ;)
           listener: endMember()
-        notEofOrValue(}, const)
+        notEofOrType(CLOSE_CURLY_BRACKET, const)
         parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Enum, E)
           parseMetadataStar(;)
             listener: beginMetadataStar(const)
@@ -127,7 +127,7 @@
               listener: handleEmptyFunctionBody(;)
             listener: endEnumConstructor(null, const, (, null, ;)
           listener: endMember()
-        notEofOrValue(}, })
+        notEofOrType(CLOSE_CURLY_BRACKET, })
         listener: endEnum(enum, enum, {, 2, })
   listener: endTopLevelDeclaration(})
   reportAllErrorTokens(enum)
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_48380_3_comma_ok.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_48380_3_comma_ok.dart.intertwined.expect
index 12ba3ba..af8b8ed 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_48380_3_comma_ok.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_48380_3_comma_ok.dart.intertwined.expect
@@ -54,7 +54,7 @@
               listener: endArguments(0, (, ))
           listener: handleEnumElement(,, null)
         listener: handleEnumElements(;, 2)
-        notEofOrValue(}, const)
+        notEofOrType(CLOSE_CURLY_BRACKET, const)
         parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Enum, E)
           parseMetadataStar(;)
             listener: beginMetadataStar(const)
@@ -85,7 +85,7 @@
               listener: handleEmptyFunctionBody(;)
             listener: endEnumConstructor(null, const, (, null, ;)
           listener: endMember()
-        notEofOrValue(}, const)
+        notEofOrType(CLOSE_CURLY_BRACKET, const)
         parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Enum, E)
           parseMetadataStar(;)
             listener: beginMetadataStar(const)
@@ -120,7 +120,7 @@
               listener: handleEmptyFunctionBody(;)
             listener: endEnumConstructor(null, const, (, null, ;)
           listener: endMember()
-        notEofOrValue(}, })
+        notEofOrType(CLOSE_CURLY_BRACKET, })
         listener: endEnum(enum, enum, {, 2, })
   listener: endTopLevelDeclaration(})
   reportAllErrorTokens(enum)
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_48380_3_ok.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_48380_3_ok.dart.intertwined.expect
index 74d1278..5af9aac 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_48380_3_ok.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_48380_3_ok.dart.intertwined.expect
@@ -37,7 +37,7 @@
               listener: endArguments(0, (, ))
           listener: handleEnumElement({, null)
         listener: handleEnumElements(;, 1)
-        notEofOrValue(}, const)
+        notEofOrType(CLOSE_CURLY_BRACKET, const)
         parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Enum, E)
           parseMetadataStar(;)
             listener: beginMetadataStar(const)
@@ -68,7 +68,7 @@
               listener: handleEmptyFunctionBody(;)
             listener: endEnumConstructor(null, const, (, null, ;)
           listener: endMember()
-        notEofOrValue(}, const)
+        notEofOrType(CLOSE_CURLY_BRACKET, const)
         parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Enum, E)
           parseMetadataStar(;)
             listener: beginMetadataStar(const)
@@ -103,7 +103,7 @@
               listener: handleEmptyFunctionBody(;)
             listener: endEnumConstructor(null, const, (, null, ;)
           listener: endMember()
-        notEofOrValue(}, })
+        notEofOrType(CLOSE_CURLY_BRACKET, })
         listener: endEnum(enum, enum, {, 2, })
   listener: endTopLevelDeclaration(})
   reportAllErrorTokens(enum)
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_48380_4.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_48380_4.dart.intertwined.expect
index 52e8a1d..4aae725 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_48380_4.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_48380_4.dart.intertwined.expect
@@ -33,7 +33,7 @@
           listener: handleNoArguments(x)
           listener: handleEnumElement({, null)
         listener: handleEnumElements(;, 1)
-        notEofOrValue(}, String)
+        notEofOrType(CLOSE_CURLY_BRACKET, String)
         parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Enum, E)
           parseMetadataStar(;)
             listener: beginMetadataStar(String)
@@ -62,7 +62,7 @@
             inPlainSync()
             parseFunctionBody(), false, true)
               listener: beginBlockFunctionBody({)
-              notEofOrValue(}, print)
+              notEofOrType(CLOSE_CURLY_BRACKET, print)
               parseStatement({)
                 parseStatementX({)
                   parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -75,7 +75,6 @@
                               parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                                 looksLikeFunctionBody(;)
                                 parseSend({, expression, ConstantPatternContext.none)
-                                  isNextIdentifier({)
                                   ensureIdentifier({, expression)
                                     listener: handleIdentifier(print, expression)
                                   listener: handleNoTypeArguments(()
@@ -95,7 +94,7 @@
                                   listener: handleSend(print, ))
                       ensureSemicolon())
                       listener: handleExpressionStatement(print, ;)
-              notEofOrValue(}, return)
+              notEofOrType(CLOSE_CURLY_BRACKET, return)
               parseStatement(;)
                 parseStatementX(;)
                   parseReturnStatement(;)
@@ -111,11 +110,11 @@
                     ensureSemicolon("hello")
                     listener: endReturnStatement(true, return, ;)
                     inGenerator()
-              notEofOrValue(}, })
+              notEofOrType(CLOSE_CURLY_BRACKET, })
               listener: endBlockFunctionBody(2, {, })
             listener: endEnumMethod(null, String, (, null, })
           listener: endMember()
-        notEofOrValue(}, })
+        notEofOrType(CLOSE_CURLY_BRACKET, })
         listener: endEnum(enum, enum, {, 1, })
   listener: endTopLevelDeclaration(})
   reportAllErrorTokens(enum)
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_48411.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_48411.dart.intertwined.expect
index 06bda3b..c7d95e3 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_48411.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_48411.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(A, DeclarationKind.Class, A)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, A)
+            notEofOrType(CLOSE_CURLY_BRACKET, A)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, A)
               parseMetadataStar({)
                 listener: beginMetadataStar(A)
@@ -67,7 +67,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, A, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, A)
+            notEofOrType(CLOSE_CURLY_BRACKET, A)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, A)
               parseMetadataStar(;)
                 listener: beginMetadataStar(A)
@@ -113,7 +113,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, A, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 2, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -143,7 +143,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(A, DeclarationKind.Class, B)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, B)
+            notEofOrType(CLOSE_CURLY_BRACKET, B)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, B)
               parseMetadataStar({)
                 listener: beginMetadataStar(B)
@@ -188,7 +188,6 @@
                               parsePrimary((, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                   parseSend((, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(()
                                     ensureIdentifier((, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(>)
@@ -227,7 +226,6 @@
                                               parsePrimary((, expression, ConstantPatternContext.none)
                                                 parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                   parseSend((, expression, ConstantPatternContext.none)
-                                                    isNextIdentifier(()
                                                     ensureIdentifier((, expression)
                                                       listener: handleIdentifier(x, expression)
                                                     listener: handleNoTypeArguments())
@@ -246,7 +244,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, B, (, :, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -276,7 +274,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(A, DeclarationKind.Class, B2)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, B2)
+            notEofOrType(CLOSE_CURLY_BRACKET, B2)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, B2)
               parseMetadataStar({)
                 listener: beginMetadataStar(B2)
@@ -321,7 +319,6 @@
                               parsePrimary((, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                   parseSend((, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(()
                                     ensureIdentifier((, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(>)
@@ -353,7 +350,6 @@
                               parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                   parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                    isNextIdentifier(.)
                                     ensureIdentifier(., expressionContinuation)
                                       listener: handleIdentifier(y, expressionContinuation)
                                     listener: handleNoTypeArguments(()
@@ -367,7 +363,6 @@
                                                 parsePrimary((, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                     parseSend((, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(()
                                                       ensureIdentifier((, expression)
                                                         listener: handleIdentifier(x, expression)
                                                       listener: handleNoTypeArguments())
@@ -387,7 +382,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, B2, (, :, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -417,7 +412,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(A, DeclarationKind.Class, B3)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, B3)
+            notEofOrType(CLOSE_CURLY_BRACKET, B3)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, B3)
               parseMetadataStar({)
                 listener: beginMetadataStar(B3)
@@ -462,7 +457,6 @@
                               parsePrimary((, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                   parseSend((, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(()
                                     ensureIdentifier((, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(>)
@@ -493,7 +487,6 @@
                             parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                 parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                  isNextIdentifier(.)
                                   ensureIdentifier(., expressionContinuation)
                                     listener: handleIdentifier(y, expressionContinuation)
                                   listener: handleNoTypeArguments(()
@@ -507,7 +500,6 @@
                                               parsePrimary((, expression, ConstantPatternContext.none)
                                                 parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                   parseSend((, expression, ConstantPatternContext.none)
-                                                    isNextIdentifier(()
                                                     ensureIdentifier((, expression)
                                                       listener: handleIdentifier(x, expression)
                                                     listener: handleNoTypeArguments())
@@ -527,7 +519,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, B3, (, :, ;)
               listener: endMember()
-            notEofOrValue(}, B3)
+            notEofOrType(CLOSE_CURLY_BRACKET, B3)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, B3)
               parseMetadataStar(;)
                 listener: beginMetadataStar(B3)
@@ -573,7 +565,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, B3, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 2, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -603,7 +595,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(A, DeclarationKind.Class, C)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, C)
               parseMetadataStar({)
                 listener: beginMetadataStar(int)
@@ -620,7 +612,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, C)
+            notEofOrType(CLOSE_CURLY_BRACKET, C)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, C)
               parseMetadataStar(;)
                 listener: beginMetadataStar(C)
@@ -665,7 +657,6 @@
                               parsePrimary((, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                   parseSend((, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(()
                                     ensureIdentifier((, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(>)
@@ -693,7 +684,6 @@
                               parsePrimary(,, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                   parseSend(,, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(,)
                                     ensureIdentifier(,, expression)
                                       listener: handleIdentifier(y, expression)
                                     listener: handleNoTypeArguments(=)
@@ -723,7 +713,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, C, (, :, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 2, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -753,7 +743,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(A, DeclarationKind.Class, D)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, D)
+            notEofOrType(CLOSE_CURLY_BRACKET, D)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, D)
               parseMetadataStar({)
                 listener: beginMetadataStar(D)
@@ -798,7 +788,6 @@
                               parsePrimary((, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                   parseSend((, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(()
                                     ensureIdentifier((, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(>)
@@ -827,7 +816,6 @@
                               parsePrimary((, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                   parseSend((, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(()
                                     ensureIdentifier((, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(-)
@@ -859,7 +847,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, D, (, :, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -889,7 +877,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(A, DeclarationKind.Class, E)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, E)
               parseMetadataStar({)
                 listener: beginMetadataStar(final)
@@ -908,7 +896,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, E)
+            notEofOrType(CLOSE_CURLY_BRACKET, E)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, E)
               parseMetadataStar(;)
                 listener: beginMetadataStar(E)
@@ -953,7 +941,6 @@
                               parsePrimary((, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                   parseSend((, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(()
                                     ensureIdentifier((, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(>)
@@ -984,7 +971,6 @@
                             parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                 parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                  isNextIdentifier(.)
                                   ensureIdentifier(., expressionContinuation)
                                     listener: handleIdentifier(y, expressionContinuation)
                                   listener: handleNoTypeArguments(=)
@@ -997,7 +983,6 @@
                                 parsePrimary(=, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                     parseSend(=, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(=)
                                       ensureIdentifier(=, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments(*)
@@ -1022,7 +1007,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, E, (, :, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 2, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_48411_prime.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_48411_prime.dart.intertwined.expect
index a4b0a83..8df0c80 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_48411_prime.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_48411_prime.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(A, DeclarationKind.Class, A)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, A)
+            notEofOrType(CLOSE_CURLY_BRACKET, A)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, A)
               parseMetadataStar({)
                 listener: beginMetadataStar(A)
@@ -67,7 +67,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, A, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, A)
+            notEofOrType(CLOSE_CURLY_BRACKET, A)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, A)
               parseMetadataStar(;)
                 listener: beginMetadataStar(A)
@@ -113,7 +113,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, A, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 2, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -143,7 +143,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(A, DeclarationKind.Class, B)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, B)
+            notEofOrType(CLOSE_CURLY_BRACKET, B)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, B)
               parseMetadataStar({)
                 listener: beginMetadataStar(B)
@@ -188,7 +188,6 @@
                               parsePrimary((, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                   parseSend((, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(()
                                     ensureIdentifier((, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(>)
@@ -224,7 +223,6 @@
                                               parsePrimary((, expression, ConstantPatternContext.none)
                                                 parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                   parseSend((, expression, ConstantPatternContext.none)
-                                                    isNextIdentifier(()
                                                     ensureIdentifier((, expression)
                                                       listener: handleIdentifier(x, expression)
                                                     listener: handleNoTypeArguments())
@@ -243,7 +241,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, B, (, :, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -273,7 +271,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(A, DeclarationKind.Class, B2)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, B2)
+            notEofOrType(CLOSE_CURLY_BRACKET, B2)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, B2)
               parseMetadataStar({)
                 listener: beginMetadataStar(B2)
@@ -318,7 +316,6 @@
                               parsePrimary((, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                   parseSend((, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(()
                                     ensureIdentifier((, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(>)
@@ -347,7 +344,6 @@
                               parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                   parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                    isNextIdentifier(.)
                                     ensureIdentifier(., expressionContinuation)
                                       listener: handleIdentifier(y, expressionContinuation)
                                     listener: handleNoTypeArguments(()
@@ -361,7 +357,6 @@
                                                 parsePrimary((, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                     parseSend((, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(()
                                                       ensureIdentifier((, expression)
                                                         listener: handleIdentifier(x, expression)
                                                       listener: handleNoTypeArguments())
@@ -381,7 +376,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, B2, (, :, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -411,7 +406,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(A, DeclarationKind.Class, B3)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, B3)
+            notEofOrType(CLOSE_CURLY_BRACKET, B3)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, B3)
               parseMetadataStar({)
                 listener: beginMetadataStar(B3)
@@ -456,7 +451,6 @@
                               parsePrimary((, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                   parseSend((, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(()
                                     ensureIdentifier((, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(>)
@@ -484,7 +478,6 @@
                             parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                 parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                  isNextIdentifier(.)
                                   ensureIdentifier(., expressionContinuation)
                                     listener: handleIdentifier(y, expressionContinuation)
                                   listener: handleNoTypeArguments(()
@@ -498,7 +491,6 @@
                                               parsePrimary((, expression, ConstantPatternContext.none)
                                                 parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                   parseSend((, expression, ConstantPatternContext.none)
-                                                    isNextIdentifier(()
                                                     ensureIdentifier((, expression)
                                                       listener: handleIdentifier(x, expression)
                                                     listener: handleNoTypeArguments())
@@ -518,7 +510,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, B3, (, :, ;)
               listener: endMember()
-            notEofOrValue(}, B3)
+            notEofOrType(CLOSE_CURLY_BRACKET, B3)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, B3)
               parseMetadataStar(;)
                 listener: beginMetadataStar(B3)
@@ -564,7 +556,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, B3, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 2, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -594,7 +586,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(A, DeclarationKind.Class, C)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, C)
               parseMetadataStar({)
                 listener: beginMetadataStar(int)
@@ -611,7 +603,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, C)
+            notEofOrType(CLOSE_CURLY_BRACKET, C)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, C)
               parseMetadataStar(;)
                 listener: beginMetadataStar(C)
@@ -656,7 +648,6 @@
                               parsePrimary((, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                   parseSend((, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(()
                                     ensureIdentifier((, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(>)
@@ -681,7 +672,6 @@
                               parsePrimary(,, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                   parseSend(,, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(,)
                                     ensureIdentifier(,, expression)
                                       listener: handleIdentifier(y, expression)
                                     listener: handleNoTypeArguments(=)
@@ -711,7 +701,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, C, (, :, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 2, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -741,7 +731,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(A, DeclarationKind.Class, D)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, D)
+            notEofOrType(CLOSE_CURLY_BRACKET, D)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, D)
               parseMetadataStar({)
                 listener: beginMetadataStar(D)
@@ -786,7 +776,6 @@
                               parsePrimary((, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                   parseSend((, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(()
                                     ensureIdentifier((, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(>)
@@ -812,7 +801,6 @@
                               parsePrimary((, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                   parseSend((, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(()
                                     ensureIdentifier((, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(-)
@@ -844,7 +832,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, D, (, :, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -874,7 +862,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(A, DeclarationKind.Class, E)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, E)
               parseMetadataStar({)
                 listener: beginMetadataStar(final)
@@ -893,7 +881,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, E)
+            notEofOrType(CLOSE_CURLY_BRACKET, E)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, E)
               parseMetadataStar(;)
                 listener: beginMetadataStar(E)
@@ -938,7 +926,6 @@
                               parsePrimary((, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                   parseSend((, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(()
                                     ensureIdentifier((, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(>)
@@ -966,7 +953,6 @@
                             parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                 parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                  isNextIdentifier(.)
                                   ensureIdentifier(., expressionContinuation)
                                     listener: handleIdentifier(y, expressionContinuation)
                                   listener: handleNoTypeArguments(=)
@@ -979,7 +965,6 @@
                                 parsePrimary(=, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                     parseSend(=, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(=)
                                       ensureIdentifier(=, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments(*)
@@ -1004,7 +989,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, E, (, :, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 2, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_48411_prime_1.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_48411_prime_1.dart.intertwined.expect
index a8341d9..0b4b2fb 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_48411_prime_1.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_48411_prime_1.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(C, DeclarationKind.Class, C)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, C)
+            notEofOrType(CLOSE_CURLY_BRACKET, C)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, C)
               parseMetadataStar({)
                 listener: beginMetadataStar(C)
@@ -61,7 +61,6 @@
                               parsePrimary((, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                   parseSend((, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(()
                                     ensureIdentifier((, expression)
                                       listener: handleIdentifier(, expression)
                                     listener: handleNoTypeArguments())
@@ -97,7 +96,7 @@
                   listener: endRedirectingFactoryBody(=, ;)
                 listener: endClassConstructor(null, C, (, :, ;)
               listener: endMember()
-            notEofOrValue(}, 0)
+            notEofOrType(CLOSE_CURLY_BRACKET, 0)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, C)
               parseMetadataStar(;)
                 listener: beginMetadataStar(0)
@@ -108,7 +107,7 @@
                   listener: handleRecoverableError(Message[ExpectedClassMember, Expected a class member, but got '0'., null, {lexeme: 0}], 0, 0)
                 listener: handleInvalidMember(0)
                 listener: endMember()
-            notEofOrValue(}, ;)
+            notEofOrType(CLOSE_CURLY_BRACKET, ;)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(0, DeclarationKind.Class, C)
               parseMetadataStar(0)
                 listener: beginMetadataStar(;)
@@ -119,7 +118,7 @@
                   listener: handleRecoverableError(Message[ExpectedClassMember, Expected a class member, but got ';'., null, {lexeme: ;}], ;, ;)
                 listener: handleInvalidMember(;)
                 listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 3, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -146,7 +145,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(C, DeclarationKind.Class, C)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, C)
+            notEofOrType(CLOSE_CURLY_BRACKET, C)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, C)
               parseMetadataStar({)
                 listener: beginMetadataStar(C)
@@ -184,7 +183,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(, expression)
                                     listener: handleNoTypeArguments(=)
@@ -196,7 +194,6 @@
                                 parsePrimary(=, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                     parseSend(=, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(=)
                                       ensureIdentifier(=, expression)
                                         listener: handleIdentifier(, expression)
                                       listener: handleNoTypeArguments(null)
@@ -220,7 +217,7 @@
                   listener: handleInvalidFunctionBody({)
                 listener: endClassConstructor(null, C, (, :, })
               listener: endMember()
-            notEofOrValue(}, null)
+            notEofOrType(CLOSE_CURLY_BRACKET, null)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, C)
               parseMetadataStar(})
                 listener: beginMetadataStar(null)
@@ -231,7 +228,7 @@
                   listener: handleRecoverableError(Message[ExpectedClassMember, Expected a class member, but got 'null'., null, {lexeme: null}], null, null)
                 listener: handleInvalidMember(null)
                 listener: endMember()
-            notEofOrValue(}, =)
+            notEofOrType(CLOSE_CURLY_BRACKET, =)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(null, DeclarationKind.Class, C)
               parseMetadataStar(null)
                 listener: beginMetadataStar(=)
@@ -276,7 +273,7 @@
                       listener: handleInvalidFunctionBody({)
                     listener: endClassMethod(null, operator, (, null, })
                   listener: endMember()
-            notEofOrValue(}, 0)
+            notEofOrType(CLOSE_CURLY_BRACKET, 0)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, C)
               parseMetadataStar(})
                 listener: beginMetadataStar(0)
@@ -287,7 +284,7 @@
                   listener: handleRecoverableError(Message[ExpectedClassMember, Expected a class member, but got '0'., null, {lexeme: 0}], 0, 0)
                 listener: handleInvalidMember(0)
                 listener: endMember()
-            notEofOrValue(}, ;)
+            notEofOrType(CLOSE_CURLY_BRACKET, ;)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(0, DeclarationKind.Class, C)
               parseMetadataStar(0)
                 listener: beginMetadataStar(;)
@@ -298,7 +295,7 @@
                   listener: handleRecoverableError(Message[ExpectedClassMember, Expected a class member, but got ';'., null, {lexeme: ;}], ;, ;)
                 listener: handleInvalidMember(;)
                 listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 5, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -325,7 +322,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(C, DeclarationKind.Class, C)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, C)
+            notEofOrType(CLOSE_CURLY_BRACKET, C)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, C)
               parseMetadataStar({)
                 listener: beginMetadataStar(C)
@@ -374,7 +371,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, C, (, :, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -401,7 +398,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(C, DeclarationKind.Class, C)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, C)
+            notEofOrType(CLOSE_CURLY_BRACKET, C)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, C)
               parseMetadataStar({)
                 listener: beginMetadataStar(C)
@@ -442,7 +439,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(, expression)
                                     listener: handleNoTypeArguments(=)
@@ -457,7 +453,6 @@
                               parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                   parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                    isNextIdentifier(.)
                                     ensureIdentifier(., expressionContinuation)
                                       listener: handleIdentifier(, expressionContinuation)
                                     listener: handleNoTypeArguments(=)
@@ -482,7 +477,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, C, (, :, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_49116.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_49116.dart.intertwined.expect
index f7ca385..668073f 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_49116.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_49116.dart.intertwined.expect
@@ -36,7 +36,6 @@
                 parseUnaryExpression(=>, true, ConstantPatternContext.none)
                   parsePrimary(=>, expression, ConstantPatternContext.none)
                     parseNewExpression(=>)
-                      isNextIdentifier(new)
                       listener: beginNewExpression(new)
                       parseConstructorReference(new, ConstructorReferenceContext.New, null)
                         ensureIdentifier(new, constructorReference)
@@ -89,7 +88,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, await)
+          notEofOrType(CLOSE_CURLY_BRACKET, await)
           parseStatement({)
             parseStatementX({)
               inPlainSync()
@@ -110,7 +109,6 @@
                               parseSendOrFunctionLiteral(await, expression, ConstantPatternContext.none)
                                 looksLikeFunctionBody(;)
                                 parseSend(await, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(await)
                                   ensureIdentifier(await, expression)
                                     listener: handleIdentifier(returnsFuture, expression)
                                   listener: handleNoTypeArguments(()
@@ -126,7 +124,7 @@
                         listener: endInvalidAwaitExpression(await, ), AwaitNotAsync)
                 ensureSemicolon())
                 listener: handleExpressionStatement(await, ;)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement(;)
             parseStatementX(;)
               parseIfStatement(;)
@@ -147,7 +145,6 @@
                                   parseSendOrFunctionLiteral(await, expression, ConstantPatternContext.none)
                                     looksLikeFunctionBody())
                                     parseSend(await, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(await)
                                       ensureIdentifier(await, expression)
                                         listener: handleIdentifier(returnsFuture, expression)
                                       listener: handleNoTypeArguments(()
@@ -169,7 +166,7 @@
                     parseBlock(), BlockKind(statement))
                       ensureBlock(), BlockKind(statement))
                       listener: beginBlock({, BlockKind(statement))
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlock(0, {, }, BlockKind(statement))
                 listener: endThenStatement({, })
                 listener: beginElseStatement(else)
@@ -195,7 +192,6 @@
                                             parseSendOrFunctionLiteral(await, expression, ConstantPatternContext.none)
                                               looksLikeFunctionBody())
                                               parseSend(await, expression, ConstantPatternContext.none)
-                                                isNextIdentifier(await)
                                                 ensureIdentifier(await, expression)
                                                   listener: handleIdentifier(returnsFuture, expression)
                                                 listener: handleNoTypeArguments(()
@@ -218,13 +214,13 @@
                           parseBlock(), BlockKind(statement))
                             ensureBlock(), BlockKind(statement))
                             listener: beginBlock({, BlockKind(statement))
-                            notEofOrValue(}, })
+                            notEofOrType(CLOSE_CURLY_BRACKET, })
                             listener: endBlock(0, {, }, BlockKind(statement))
                       listener: endThenStatement({, })
                       listener: endIfStatement(if, null, })
                 listener: endElseStatement(else, })
                 listener: endIfStatement(if, else, })
-          notEofOrValue(}, print)
+          notEofOrType(CLOSE_CURLY_BRACKET, print)
           parseStatement(})
             parseStatementX(})
               parseExpressionStatementOrDeclarationAfterModifiers(}, }, null, null, null, null)
@@ -237,7 +233,6 @@
                           parseSendOrFunctionLiteral(}, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend(}, expression, ConstantPatternContext.none)
-                              isNextIdentifier(})
                               ensureIdentifier(}, expression)
                                 listener: handleIdentifier(print, expression)
                               listener: handleNoTypeArguments(()
@@ -259,7 +254,6 @@
                                                   parseSendOrFunctionLiteral(await, expression, ConstantPatternContext.none)
                                                     looksLikeFunctionBody())
                                                     parseSend(await, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(await)
                                                       ensureIdentifier(await, expression)
                                                         listener: handleIdentifier(returnsFuture, expression)
                                                       listener: handleNoTypeArguments(()
@@ -277,7 +271,7 @@
                               listener: handleSend(print, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(print, ;)
-          notEofOrValue(}, xor)
+          notEofOrType(CLOSE_CURLY_BRACKET, xor)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -290,7 +284,6 @@
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(xor, expression)
                               listener: handleNoTypeArguments(()
@@ -312,7 +305,6 @@
                                                   parseSendOrFunctionLiteral(await, expression, ConstantPatternContext.none)
                                                     looksLikeFunctionBody(,)
                                                     parseSend(await, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(await)
                                                       ensureIdentifier(await, expression)
                                                         listener: handleIdentifier(returnsFuture, expression)
                                                       listener: handleNoTypeArguments(()
@@ -340,7 +332,6 @@
                                                   parseSendOrFunctionLiteral(await, expression, ConstantPatternContext.none)
                                                     looksLikeFunctionBody(,)
                                                     parseSend(await, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(await)
                                                       ensureIdentifier(await, expression)
                                                         listener: handleIdentifier(returnsFuture, expression)
                                                       listener: handleNoTypeArguments(()
@@ -368,7 +359,6 @@
                                                   parseSendOrFunctionLiteral(await, expression, ConstantPatternContext.none)
                                                     looksLikeFunctionBody())
                                                     parseSend(await, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(await)
                                                       ensureIdentifier(await, expression)
                                                         listener: handleIdentifier(returnsFuture, expression)
                                                       listener: handleNoTypeArguments(()
@@ -386,7 +376,7 @@
                               listener: handleSend(xor, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(xor, ;)
-          notEofOrValue(}, await)
+          notEofOrType(CLOSE_CURLY_BRACKET, await)
           parseStatement(;)
             parseStatementX(;)
               inPlainSync()
@@ -407,7 +397,6 @@
                               parseSendOrFunctionLiteral(await, expression, ConstantPatternContext.none)
                                 looksLikeFunctionBody(^)
                                 parseSend(await, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(await)
                                   ensureIdentifier(await, expression)
                                     listener: handleIdentifier(returnsFuture, expression)
                                   listener: handleNoTypeArguments(()
@@ -435,7 +424,6 @@
                                 parseSendOrFunctionLiteral(await, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody(;)
                                   parseSend(await, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(await)
                                     ensureIdentifier(await, expression)
                                       listener: handleIdentifier(returnsFuture, expression)
                                     listener: handleNoTypeArguments(()
@@ -452,7 +440,7 @@
                     listener: endBinaryExpression(^, ))
                 ensureSemicolon())
                 listener: handleExpressionStatement(await, ;)
-          notEofOrValue(}, print)
+          notEofOrType(CLOSE_CURLY_BRACKET, print)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -465,7 +453,6 @@
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(print, expression)
                               listener: handleNoTypeArguments(()
@@ -487,7 +474,6 @@
                                                   parseSendOrFunctionLiteral(await, expression, ConstantPatternContext.none)
                                                     looksLikeFunctionBody(^)
                                                     parseSend(await, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(await)
                                                       ensureIdentifier(await, expression)
                                                         listener: handleIdentifier(returnsFuture, expression)
                                                       listener: handleNoTypeArguments(()
@@ -515,7 +501,6 @@
                                                     parseSendOrFunctionLiteral(await, expression, ConstantPatternContext.none)
                                                       looksLikeFunctionBody())
                                                       parseSend(await, expression, ConstantPatternContext.none)
-                                                        isNextIdentifier(await)
                                                         ensureIdentifier(await, expression)
                                                           listener: handleIdentifier(returnsFuture, expression)
                                                         listener: handleNoTypeArguments(()
@@ -534,7 +519,7 @@
                               listener: handleSend(print, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(print, ;)
-          notEofOrValue(}, await)
+          notEofOrType(CLOSE_CURLY_BRACKET, await)
           parseStatement(;)
             parseStatementX(;)
               inPlainSync()
@@ -555,7 +540,6 @@
                               parseSendOrFunctionLiteral(await, expression, ConstantPatternContext.none)
                                 looksLikeFunctionBody(+)
                                 parseSend(await, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(await)
                                   ensureIdentifier(await, expression)
                                     listener: handleIdentifier(returnsFuture, expression)
                                   listener: handleNoTypeArguments(()
@@ -583,7 +567,6 @@
                                 parseSendOrFunctionLiteral(await, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody(;)
                                   parseSend(await, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(await)
                                     ensureIdentifier(await, expression)
                                       listener: handleIdentifier(returnsFuture, expression)
                                     listener: handleNoTypeArguments(()
@@ -600,7 +583,7 @@
                     listener: endBinaryExpression(+, ))
                 ensureSemicolon())
                 listener: handleExpressionStatement(await, ;)
-          notEofOrValue(}, print)
+          notEofOrType(CLOSE_CURLY_BRACKET, print)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -613,7 +596,6 @@
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(print, expression)
                               listener: handleNoTypeArguments(()
@@ -635,7 +617,6 @@
                                                   parseSendOrFunctionLiteral(await, expression, ConstantPatternContext.none)
                                                     looksLikeFunctionBody(+)
                                                     parseSend(await, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(await)
                                                       ensureIdentifier(await, expression)
                                                         listener: handleIdentifier(returnsFuture, expression)
                                                       listener: handleNoTypeArguments(()
@@ -663,7 +644,6 @@
                                                     parseSendOrFunctionLiteral(await, expression, ConstantPatternContext.none)
                                                       looksLikeFunctionBody())
                                                       parseSend(await, expression, ConstantPatternContext.none)
-                                                        isNextIdentifier(await)
                                                         ensureIdentifier(await, expression)
                                                           listener: handleIdentifier(returnsFuture, expression)
                                                         listener: handleNoTypeArguments(()
@@ -682,7 +662,7 @@
                               listener: handleSend(print, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(print, ;)
-          notEofOrValue(}, await)
+          notEofOrType(CLOSE_CURLY_BRACKET, await)
           parseStatement(;)
             parseStatementX(;)
               inPlainSync()
@@ -703,7 +683,6 @@
                               parseSendOrFunctionLiteral(await, expression, ConstantPatternContext.none)
                                 looksLikeFunctionBody(-)
                                 parseSend(await, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(await)
                                   ensureIdentifier(await, expression)
                                     listener: handleIdentifier(returnsFuture, expression)
                                   listener: handleNoTypeArguments(()
@@ -731,7 +710,6 @@
                                 parseSendOrFunctionLiteral(await, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody(;)
                                   parseSend(await, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(await)
                                     ensureIdentifier(await, expression)
                                       listener: handleIdentifier(returnsFuture, expression)
                                     listener: handleNoTypeArguments(()
@@ -748,7 +726,7 @@
                     listener: endBinaryExpression(-, ))
                 ensureSemicolon())
                 listener: handleExpressionStatement(await, ;)
-          notEofOrValue(}, print)
+          notEofOrType(CLOSE_CURLY_BRACKET, print)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -761,7 +739,6 @@
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(print, expression)
                               listener: handleNoTypeArguments(()
@@ -783,7 +760,6 @@
                                                   parseSendOrFunctionLiteral(await, expression, ConstantPatternContext.none)
                                                     looksLikeFunctionBody(-)
                                                     parseSend(await, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(await)
                                                       ensureIdentifier(await, expression)
                                                         listener: handleIdentifier(returnsFuture, expression)
                                                       listener: handleNoTypeArguments(()
@@ -811,7 +787,6 @@
                                                     parseSendOrFunctionLiteral(await, expression, ConstantPatternContext.none)
                                                       looksLikeFunctionBody())
                                                       parseSend(await, expression, ConstantPatternContext.none)
-                                                        isNextIdentifier(await)
                                                         ensureIdentifier(await, expression)
                                                           listener: handleIdentifier(returnsFuture, expression)
                                                         listener: handleNoTypeArguments(()
@@ -830,7 +805,7 @@
                               listener: handleSend(print, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(print, ;)
-          notEofOrValue(}, !)
+          notEofOrType(CLOSE_CURLY_BRACKET, !)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -853,7 +828,6 @@
                                       parseSendOrFunctionLiteral(await, expression, ConstantPatternContext.none)
                                         looksLikeFunctionBody(^)
                                         parseSend(await, expression, ConstantPatternContext.none)
-                                          isNextIdentifier(await)
                                           ensureIdentifier(await, expression)
                                             listener: handleIdentifier(returnsFuture, expression)
                                           listener: handleNoTypeArguments(()
@@ -884,7 +858,6 @@
                                         parseSendOrFunctionLiteral(await, expression, ConstantPatternContext.none)
                                           looksLikeFunctionBody(;)
                                           parseSend(await, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(await)
                                             ensureIdentifier(await, expression)
                                               listener: handleIdentifier(returnsFuture, expression)
                                             listener: handleNoTypeArguments(()
@@ -902,7 +875,7 @@
                         listener: endBinaryExpression(^, ))
                     ensureSemicolon())
                     listener: handleExpressionStatement(!, ;)
-          notEofOrValue(}, print)
+          notEofOrType(CLOSE_CURLY_BRACKET, print)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -915,7 +888,6 @@
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(print, expression)
                               listener: handleNoTypeArguments(()
@@ -939,7 +911,6 @@
                                                       parseSendOrFunctionLiteral(await, expression, ConstantPatternContext.none)
                                                         looksLikeFunctionBody(^)
                                                         parseSend(await, expression, ConstantPatternContext.none)
-                                                          isNextIdentifier(await)
                                                           ensureIdentifier(await, expression)
                                                             listener: handleIdentifier(returnsFuture, expression)
                                                           listener: handleNoTypeArguments(()
@@ -970,7 +941,6 @@
                                                         parseSendOrFunctionLiteral(await, expression, ConstantPatternContext.none)
                                                           looksLikeFunctionBody())
                                                           parseSend(await, expression, ConstantPatternContext.none)
-                                                            isNextIdentifier(await)
                                                             ensureIdentifier(await, expression)
                                                               listener: handleIdentifier(returnsFuture, expression)
                                                             listener: handleNoTypeArguments(()
@@ -990,7 +960,7 @@
                               listener: handleSend(print, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(print, ;)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(var, ;, null, var, null, null)
@@ -1013,7 +983,6 @@
                               parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                 looksLikeFunctionBody(;)
                                 parseSend(=, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(=)
                                   ensureIdentifier(=, expression)
                                     listener: handleIdentifier(returnsFuture, expression)
                                   listener: handleNoTypeArguments(()
@@ -1027,7 +996,7 @@
                     listener: endInitializedIdentifier(f)
                   ensureSemicolon())
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, await)
+          notEofOrType(CLOSE_CURLY_BRACKET, await)
           parseStatement(;)
             parseStatementX(;)
               inPlainSync()
@@ -1052,7 +1021,7 @@
                       listener: endInitializedIdentifier(f)
                     ensureSemicolon(f)
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement(;)
             parseStatementX(;)
               parseIfStatement(;)
@@ -1072,7 +1041,6 @@
                                 parsePrimary(await, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(await, expression, ConstantPatternContext.none)
                                     parseSend(await, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(await)
                                       ensureIdentifier(await, expression)
                                         listener: handleIdentifier(f, expression)
                                       listener: handleNoTypeArguments())
@@ -1091,7 +1059,7 @@
                     parseBlock(), BlockKind(statement))
                       ensureBlock(), BlockKind(statement))
                       listener: beginBlock({, BlockKind(statement))
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlock(0, {, }, BlockKind(statement))
                 listener: endThenStatement({, })
                 listener: beginElseStatement(else)
@@ -1116,7 +1084,6 @@
                                           parsePrimary(await, expression, ConstantPatternContext.none)
                                             parseSendOrFunctionLiteral(await, expression, ConstantPatternContext.none)
                                               parseSend(await, expression, ConstantPatternContext.none)
-                                                isNextIdentifier(await)
                                                 ensureIdentifier(await, expression)
                                                   listener: handleIdentifier(f, expression)
                                                 listener: handleNoTypeArguments())
@@ -1136,13 +1103,13 @@
                           parseBlock(), BlockKind(statement))
                             ensureBlock(), BlockKind(statement))
                             listener: beginBlock({, BlockKind(statement))
-                            notEofOrValue(}, })
+                            notEofOrType(CLOSE_CURLY_BRACKET, })
                             listener: endBlock(0, {, }, BlockKind(statement))
                       listener: endThenStatement({, })
                       listener: endIfStatement(if, null, })
                 listener: endElseStatement(else, })
                 listener: endIfStatement(if, else, })
-          notEofOrValue(}, print)
+          notEofOrType(CLOSE_CURLY_BRACKET, print)
           parseStatement(})
             parseStatementX(})
               parseExpressionStatementOrDeclarationAfterModifiers(}, }, null, null, null, null)
@@ -1155,7 +1122,6 @@
                           parseSendOrFunctionLiteral(}, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend(}, expression, ConstantPatternContext.none)
-                              isNextIdentifier(})
                               ensureIdentifier(}, expression)
                                 listener: handleIdentifier(print, expression)
                               listener: handleNoTypeArguments(()
@@ -1176,7 +1142,6 @@
                                                 parsePrimary(await, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral(await, expression, ConstantPatternContext.none)
                                                     parseSend(await, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(await)
                                                       ensureIdentifier(await, expression)
                                                         listener: handleIdentifier(f, expression)
                                                       listener: handleNoTypeArguments())
@@ -1191,7 +1156,7 @@
                               listener: handleSend(print, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(print, ;)
-          notEofOrValue(}, xor)
+          notEofOrType(CLOSE_CURLY_BRACKET, xor)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -1204,7 +1169,6 @@
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(xor, expression)
                               listener: handleNoTypeArguments(()
@@ -1225,7 +1189,6 @@
                                                 parsePrimary(await, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral(await, expression, ConstantPatternContext.none)
                                                     parseSend(await, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(await)
                                                       ensureIdentifier(await, expression)
                                                         listener: handleIdentifier(f, expression)
                                                       listener: handleNoTypeArguments(,)
@@ -1249,7 +1212,6 @@
                                                 parsePrimary(await, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral(await, expression, ConstantPatternContext.none)
                                                     parseSend(await, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(await)
                                                       ensureIdentifier(await, expression)
                                                         listener: handleIdentifier(f, expression)
                                                       listener: handleNoTypeArguments(,)
@@ -1273,7 +1235,6 @@
                                                 parsePrimary(await, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral(await, expression, ConstantPatternContext.none)
                                                     parseSend(await, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(await)
                                                       ensureIdentifier(await, expression)
                                                         listener: handleIdentifier(f, expression)
                                                       listener: handleNoTypeArguments())
@@ -1288,7 +1249,7 @@
                               listener: handleSend(xor, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(xor, ;)
-          notEofOrValue(}, await)
+          notEofOrType(CLOSE_CURLY_BRACKET, await)
           parseStatement(;)
             parseStatementX(;)
               inPlainSync()
@@ -1308,7 +1269,6 @@
                             parsePrimary(await, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(await, expression, ConstantPatternContext.none)
                                 parseSend(await, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(await)
                                   ensureIdentifier(await, expression)
                                     listener: handleIdentifier(f, expression)
                                   listener: handleNoTypeArguments(^)
@@ -1332,7 +1292,6 @@
                               parsePrimary(await, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(await, expression, ConstantPatternContext.none)
                                   parseSend(await, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(await)
                                     ensureIdentifier(await, expression)
                                       listener: handleIdentifier(f, expression)
                                     listener: handleNoTypeArguments(;)
@@ -1346,7 +1305,7 @@
                     listener: endBinaryExpression(^, f)
                 ensureSemicolon(f)
                 listener: handleExpressionStatement(await, ;)
-          notEofOrValue(}, print)
+          notEofOrType(CLOSE_CURLY_BRACKET, print)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -1359,7 +1318,6 @@
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(print, expression)
                               listener: handleNoTypeArguments(()
@@ -1380,7 +1338,6 @@
                                                 parsePrimary(await, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral(await, expression, ConstantPatternContext.none)
                                                     parseSend(await, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(await)
                                                       ensureIdentifier(await, expression)
                                                         listener: handleIdentifier(f, expression)
                                                       listener: handleNoTypeArguments(^)
@@ -1404,7 +1361,6 @@
                                                   parsePrimary(await, expression, ConstantPatternContext.none)
                                                     parseSendOrFunctionLiteral(await, expression, ConstantPatternContext.none)
                                                       parseSend(await, expression, ConstantPatternContext.none)
-                                                        isNextIdentifier(await)
                                                         ensureIdentifier(await, expression)
                                                           listener: handleIdentifier(f, expression)
                                                         listener: handleNoTypeArguments())
@@ -1420,7 +1376,7 @@
                               listener: handleSend(print, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(print, ;)
-          notEofOrValue(}, await)
+          notEofOrType(CLOSE_CURLY_BRACKET, await)
           parseStatement(;)
             parseStatementX(;)
               inPlainSync()
@@ -1440,7 +1396,6 @@
                             parsePrimary(await, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(await, expression, ConstantPatternContext.none)
                                 parseSend(await, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(await)
                                   ensureIdentifier(await, expression)
                                     listener: handleIdentifier(f, expression)
                                   listener: handleNoTypeArguments(+)
@@ -1464,7 +1419,6 @@
                               parsePrimary(await, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(await, expression, ConstantPatternContext.none)
                                   parseSend(await, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(await)
                                     ensureIdentifier(await, expression)
                                       listener: handleIdentifier(f, expression)
                                     listener: handleNoTypeArguments(;)
@@ -1478,7 +1432,7 @@
                     listener: endBinaryExpression(+, f)
                 ensureSemicolon(f)
                 listener: handleExpressionStatement(await, ;)
-          notEofOrValue(}, print)
+          notEofOrType(CLOSE_CURLY_BRACKET, print)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -1491,7 +1445,6 @@
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(print, expression)
                               listener: handleNoTypeArguments(()
@@ -1512,7 +1465,6 @@
                                                 parsePrimary(await, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral(await, expression, ConstantPatternContext.none)
                                                     parseSend(await, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(await)
                                                       ensureIdentifier(await, expression)
                                                         listener: handleIdentifier(f, expression)
                                                       listener: handleNoTypeArguments(+)
@@ -1536,7 +1488,6 @@
                                                   parsePrimary(await, expression, ConstantPatternContext.none)
                                                     parseSendOrFunctionLiteral(await, expression, ConstantPatternContext.none)
                                                       parseSend(await, expression, ConstantPatternContext.none)
-                                                        isNextIdentifier(await)
                                                         ensureIdentifier(await, expression)
                                                           listener: handleIdentifier(f, expression)
                                                         listener: handleNoTypeArguments())
@@ -1552,7 +1503,7 @@
                               listener: handleSend(print, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(print, ;)
-          notEofOrValue(}, await)
+          notEofOrType(CLOSE_CURLY_BRACKET, await)
           parseStatement(;)
             parseStatementX(;)
               inPlainSync()
@@ -1572,7 +1523,6 @@
                             parsePrimary(await, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(await, expression, ConstantPatternContext.none)
                                 parseSend(await, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(await)
                                   ensureIdentifier(await, expression)
                                     listener: handleIdentifier(f, expression)
                                   listener: handleNoTypeArguments(-)
@@ -1596,7 +1546,6 @@
                               parsePrimary(await, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(await, expression, ConstantPatternContext.none)
                                   parseSend(await, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(await)
                                     ensureIdentifier(await, expression)
                                       listener: handleIdentifier(f, expression)
                                     listener: handleNoTypeArguments(;)
@@ -1610,7 +1559,7 @@
                     listener: endBinaryExpression(-, f)
                 ensureSemicolon(f)
                 listener: handleExpressionStatement(await, ;)
-          notEofOrValue(}, print)
+          notEofOrType(CLOSE_CURLY_BRACKET, print)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -1623,7 +1572,6 @@
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(print, expression)
                               listener: handleNoTypeArguments(()
@@ -1644,7 +1592,6 @@
                                                 parsePrimary(await, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral(await, expression, ConstantPatternContext.none)
                                                     parseSend(await, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(await)
                                                       ensureIdentifier(await, expression)
                                                         listener: handleIdentifier(f, expression)
                                                       listener: handleNoTypeArguments(-)
@@ -1668,7 +1615,6 @@
                                                   parsePrimary(await, expression, ConstantPatternContext.none)
                                                     parseSendOrFunctionLiteral(await, expression, ConstantPatternContext.none)
                                                       parseSend(await, expression, ConstantPatternContext.none)
-                                                        isNextIdentifier(await)
                                                         ensureIdentifier(await, expression)
                                                           listener: handleIdentifier(f, expression)
                                                         listener: handleNoTypeArguments())
@@ -1684,7 +1630,7 @@
                               listener: handleSend(print, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(print, ;)
-          notEofOrValue(}, !)
+          notEofOrType(CLOSE_CURLY_BRACKET, !)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1706,7 +1652,6 @@
                                     parsePrimary(await, expression, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral(await, expression, ConstantPatternContext.none)
                                         parseSend(await, expression, ConstantPatternContext.none)
-                                          isNextIdentifier(await)
                                           ensureIdentifier(await, expression)
                                             listener: handleIdentifier(f, expression)
                                           listener: handleNoTypeArguments(^)
@@ -1733,7 +1678,6 @@
                                       parsePrimary(await, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral(await, expression, ConstantPatternContext.none)
                                           parseSend(await, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(await)
                                             ensureIdentifier(await, expression)
                                               listener: handleIdentifier(f, expression)
                                             listener: handleNoTypeArguments(;)
@@ -1748,7 +1692,7 @@
                         listener: endBinaryExpression(^, f)
                     ensureSemicolon(f)
                     listener: handleExpressionStatement(!, ;)
-          notEofOrValue(}, print)
+          notEofOrType(CLOSE_CURLY_BRACKET, print)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -1761,7 +1705,6 @@
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(print, expression)
                               listener: handleNoTypeArguments(()
@@ -1784,7 +1727,6 @@
                                                     parsePrimary(await, expression, ConstantPatternContext.none)
                                                       parseSendOrFunctionLiteral(await, expression, ConstantPatternContext.none)
                                                         parseSend(await, expression, ConstantPatternContext.none)
-                                                          isNextIdentifier(await)
                                                           ensureIdentifier(await, expression)
                                                             listener: handleIdentifier(f, expression)
                                                           listener: handleNoTypeArguments(^)
@@ -1811,7 +1753,6 @@
                                                       parsePrimary(await, expression, ConstantPatternContext.none)
                                                         parseSendOrFunctionLiteral(await, expression, ConstantPatternContext.none)
                                                           parseSend(await, expression, ConstantPatternContext.none)
-                                                            isNextIdentifier(await)
                                                             ensureIdentifier(await, expression)
                                                               listener: handleIdentifier(f, expression)
                                                             listener: handleNoTypeArguments())
@@ -1828,7 +1769,7 @@
                               listener: handleSend(print, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(print, ;)
-          notEofOrValue(}, await)
+          notEofOrType(CLOSE_CURLY_BRACKET, await)
           parseStatement(;)
             parseStatementX(;)
               inPlainSync()
@@ -1853,7 +1794,7 @@
                       listener: endInitializedIdentifier(x)
                     ensureSemicolon(x)
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, await)
+          notEofOrType(CLOSE_CURLY_BRACKET, await)
           parseStatement(;)
             parseStatementX(;)
               inPlainSync()
@@ -1885,7 +1826,7 @@
                       listener: endInitializedIdentifier(z)
                     ensureSemicolon(z)
                     listener: endVariablesDeclaration(2, ;)
-          notEofOrValue(}, await)
+          notEofOrType(CLOSE_CURLY_BRACKET, await)
           parseStatement(;)
             parseStatementX(;)
               inPlainSync()
@@ -1917,7 +1858,6 @@
                                 inPlainSync()
                                 parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                   parseSend(=, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(=)
                                     ensureIdentifier(=, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(await, expression)
@@ -1929,7 +1869,7 @@
                       listener: endInitializedIdentifier(x2)
                     ensureSemicolon(await)
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, await)
+          notEofOrType(CLOSE_CURLY_BRACKET, await)
           parseStatement(;)
             parseStatementX(;)
               inPlainSync()
@@ -1961,7 +1901,6 @@
                                 inPlainSync()
                                 parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                   parseSend(=, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(=)
                                     ensureIdentifier(=, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(await, expression)
@@ -1987,7 +1926,6 @@
                                 inPlainSync()
                                 parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                   parseSend(=, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(=)
                                     ensureIdentifier(=, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(await, expression)
@@ -1999,7 +1937,7 @@
                       listener: endInitializedIdentifier(z2)
                     ensureSemicolon(await)
                     listener: endVariablesDeclaration(2, ;)
-          notEofOrValue(}, await)
+          notEofOrType(CLOSE_CURLY_BRACKET, await)
           parseStatement(;)
             parseStatementX(;)
               inPlainSync()
@@ -2044,7 +1982,7 @@
                         inPlainSync()
                       parseFunctionBody(), false, false)
                         listener: beginBlockFunctionBody({)
-                        notEofOrValue(}, return)
+                        notEofOrType(CLOSE_CURLY_BRACKET, return)
                         parseStatement({)
                           parseStatementX({)
                             parseReturnStatement({)
@@ -2054,7 +1992,6 @@
                                   parseUnaryExpression(return, true, ConstantPatternContext.none)
                                     parsePrimary(return, expression, ConstantPatternContext.none)
                                       parseNewExpression(return)
-                                        isNextIdentifier(new)
                                         listener: beginNewExpression(new)
                                         parseConstructorReference(new, ConstructorReferenceContext.New, null)
                                           ensureIdentifier(new, constructorReference)
@@ -2073,10 +2010,10 @@
                               ensureSemicolon())
                               listener: endReturnStatement(true, return, ;)
                               inGenerator()
-                        notEofOrValue(}, })
+                        notEofOrType(CLOSE_CURLY_BRACKET, })
                         listener: endBlockFunctionBody(1, {, })
                     listener: endLocalFunctionDeclaration(})
-          notEofOrValue(}, await)
+          notEofOrType(CLOSE_CURLY_BRACKET, await)
           parseStatement(})
             parseStatementX(})
               inPlainSync()
@@ -2145,7 +2082,7 @@
                         inPlainSync()
                       parseFunctionBody(), false, false)
                         listener: beginBlockFunctionBody({)
-                        notEofOrValue(}, return)
+                        notEofOrType(CLOSE_CURLY_BRACKET, return)
                         parseStatement({)
                           parseStatementX({)
                             parseReturnStatement({)
@@ -2156,7 +2093,6 @@
                                     parsePrimary(return, expression, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                         parseSend(return, expression, ConstantPatternContext.none)
-                                          isNextIdentifier(return)
                                           ensureIdentifier(return, expression)
                                             listener: handleIdentifier(baz, expression)
                                           listener: handleNoTypeArguments(;)
@@ -2166,10 +2102,10 @@
                               ensureSemicolon(baz)
                               listener: endReturnStatement(true, return, ;)
                               inGenerator()
-                        notEofOrValue(}, })
+                        notEofOrType(CLOSE_CURLY_BRACKET, })
                         listener: endBlockFunctionBody(1, {, })
                     listener: endLocalFunctionDeclaration(})
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(31, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -2234,7 +2170,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement({)
             parseStatementX({)
               parseReturnStatement({)
@@ -2245,7 +2181,6 @@
                       parsePrimary(return, expression, ConstantPatternContext.none)
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               listener: handleIdentifier(b, expression)
                             listener: handleNoTypeArguments(^)
@@ -2258,7 +2193,6 @@
                         parsePrimary(^, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(^, expression, ConstantPatternContext.none)
                             parseSend(^, expression, ConstantPatternContext.none)
-                              isNextIdentifier(^)
                               ensureIdentifier(^, expression)
                                 listener: handleIdentifier(b, expression)
                               listener: handleNoTypeArguments(^)
@@ -2272,7 +2206,6 @@
                         parsePrimary(^, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(^, expression, ConstantPatternContext.none)
                             parseSend(^, expression, ConstantPatternContext.none)
-                              isNextIdentifier(^)
                               ensureIdentifier(^, expression)
                                 listener: handleIdentifier(c, expression)
                               listener: handleNoTypeArguments(;)
@@ -2283,7 +2216,7 @@
                 ensureSemicolon(c)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(bool, null, })
   listener: endTopLevelDeclaration(})
@@ -2310,7 +2243,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(await, DeclarationKind.Class, await)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_49477.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_49477.dart.intertwined.expect
index f88c864..7cdd316 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_49477.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_49477.dart.intertwined.expect
@@ -64,7 +64,7 @@
           inPlainSync()
         parseFunctionBody(async, false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, final)
+          notEofOrType(CLOSE_CURLY_BRACKET, final)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(final, {, null, final, null, null)
@@ -91,7 +91,6 @@
                                   parsePrimary(await, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(await, expression, ConstantPatternContext.none)
                                       parseSend(await, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(await)
                                         ensureIdentifier(await, expression)
                                           listener: handleIdentifier(Process, expression)
                                         listener: handleNoTypeArguments(.)
@@ -101,7 +100,6 @@
                                 parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                     parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                      isNextIdentifier(.)
                                       ensureIdentifier(., expressionContinuation)
                                         listener: handleIdentifier(start, expressionContinuation)
                                       listener: handleNoTypeArguments(()
@@ -136,7 +134,7 @@
                     listener: endInitializedIdentifier(proc)
                   ensureSemicolon())
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, proc)
+          notEofOrType(CLOSE_CURLY_BRACKET, proc)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -148,7 +146,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(proc, expression)
                               listener: handleNoTypeArguments(.)
@@ -158,7 +155,6 @@
                       parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                         parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                           parseSend(., expressionContinuation, ConstantPatternContext.none)
-                            isNextIdentifier(.)
                             ensureIdentifier(., expressionContinuation)
                               listener: handleIdentifier(stdout, expressionContinuation)
                             listener: handleNoTypeArguments(.)
@@ -169,7 +165,6 @@
                       parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                         parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                           parseSend(., expressionContinuation, ConstantPatternContext.none)
-                            isNextIdentifier(.)
                             ensureIdentifier(., expressionContinuation)
                               reportRecoverableErrorWithToken(void, Template(ExpectedIdentifier))
                                 listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got 'void'., Try inserting an identifier before 'void'., {lexeme: void}], void, void)
@@ -185,7 +180,7 @@
                       listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], ., .)
                     rewriter()
                   listener: handleExpressionStatement(proc, ;)
-          notEofOrValue(}, void)
+          notEofOrType(CLOSE_CURLY_BRACKET, void)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -225,10 +220,10 @@
                         inPlainSync()
                       parseFunctionBody(), false, false)
                         listener: beginBlockFunctionBody({)
-                        notEofOrValue(}, })
+                        notEofOrType(CLOSE_CURLY_BRACKET, })
                         listener: endBlockFunctionBody(0, {, })
                     listener: endLocalFunctionDeclaration(})
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(3, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_49477_prime.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_49477_prime.dart.intertwined.expect
index ee4bb27..83fe13b 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_49477_prime.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_49477_prime.dart.intertwined.expect
@@ -64,7 +64,7 @@
           inPlainSync()
         parseFunctionBody(async, false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, final)
+          notEofOrType(CLOSE_CURLY_BRACKET, final)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(final, {, null, final, null, null)
@@ -91,7 +91,6 @@
                                   parsePrimary(await, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(await, expression, ConstantPatternContext.none)
                                       parseSend(await, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(await)
                                         ensureIdentifier(await, expression)
                                           listener: handleIdentifier(Process, expression)
                                         listener: handleNoTypeArguments(.)
@@ -101,7 +100,6 @@
                                 parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                     parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                      isNextIdentifier(.)
                                       ensureIdentifier(., expressionContinuation)
                                         listener: handleIdentifier(start, expressionContinuation)
                                       listener: handleNoTypeArguments(()
@@ -136,7 +134,7 @@
                     listener: endInitializedIdentifier(proc)
                   ensureSemicolon())
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, proc)
+          notEofOrType(CLOSE_CURLY_BRACKET, proc)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -148,7 +146,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(proc, expression)
                               listener: handleNoTypeArguments(.)
@@ -158,7 +155,6 @@
                       parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                         parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                           parseSend(., expressionContinuation, ConstantPatternContext.none)
-                            isNextIdentifier(.)
                             ensureIdentifier(., expressionContinuation)
                               listener: handleIdentifier(stdout, expressionContinuation)
                             listener: handleNoTypeArguments(.)
@@ -169,7 +165,6 @@
                       parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                         parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                           parseSend(., expressionContinuation, ConstantPatternContext.none)
-                            isNextIdentifier(.)
                             ensureIdentifier(., expressionContinuation)
                               listener: handleIdentifier(int, expressionContinuation)
                             listener: handleNoTypeArguments(getNumber)
@@ -182,7 +177,7 @@
                       listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], int, int)
                     rewriter()
                   listener: handleExpressionStatement(proc, ;)
-          notEofOrValue(}, getNumber)
+          notEofOrType(CLOSE_CURLY_BRACKET, getNumber)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -209,7 +204,7 @@
                       inPlainSync()
                     parseFunctionBody(), false, false)
                       listener: beginBlockFunctionBody({)
-                      notEofOrValue(}, return)
+                      notEofOrType(CLOSE_CURLY_BRACKET, return)
                       parseStatement({)
                         parseStatementX({)
                           parseReturnStatement({)
@@ -223,10 +218,10 @@
                             ensureSemicolon(42)
                             listener: endReturnStatement(true, return, ;)
                             inGenerator()
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlockFunctionBody(1, {, })
                   listener: endLocalFunctionDeclaration(})
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(3, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_50838.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_50838.dart.intertwined.expect
index a692bad..06cd8f8 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_50838.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_50838.dart.intertwined.expect
@@ -21,7 +21,7 @@
           listener: handleMixinHeader(mixin)
         parseClassOrMixinOrExtensionBody(M, DeclarationKind.Mixin, M)
           listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Mixin, {)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endClassOrMixinOrExtensionBody(DeclarationKind.Mixin, 0, {, })
         listener: endMixinDeclaration(mixin, })
   listener: endTopLevelDeclaration(})
@@ -64,7 +64,7 @@
         ensureBlock(M, BlockKind(mixin declaration))
         parseClassOrMixinOrExtensionBody(M, DeclarationKind.Mixin, N)
           listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Mixin, {)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endClassOrMixinOrExtensionBody(DeclarationKind.Mixin, 0, {, })
         listener: endMixinDeclaration(mixin, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_51759.crash_dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_51759.crash_dart.intertwined.expect
index b1dd63f..6beb21d 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_51759.crash_dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_51759.crash_dart.intertwined.expect
@@ -25,7 +25,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, x)
+          notEofOrType(CLOSE_CURLY_BRACKET, x)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -49,7 +49,7 @@
                       listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], a, a)
                     rewriter()
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, <)
+          notEofOrType(CLOSE_CURLY_BRACKET, <)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -105,7 +105,7 @@
                         listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], ;, ;)
                       rewriter()
                     listener: handleExpressionStatement(<, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_51759_as_reported.crash_dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_51759_as_reported.crash_dart.intertwined.expect
index 05ece80..cfb5488 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_51759_as_reported.crash_dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_51759_as_reported.crash_dart.intertwined.expect
@@ -25,7 +25,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, x)
+          notEofOrType(CLOSE_CURLY_BRACKET, x)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -49,7 +49,7 @@
                       listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], a, a)
                     rewriter()
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, <)
+          notEofOrType(CLOSE_CURLY_BRACKET, <)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -110,7 +110,7 @@
                         listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], ;, ;)
                       rewriter()
                     listener: handleExpressionStatement(<, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_51759_prime.crash_dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_51759_prime.crash_dart.intertwined.expect
index 36b559d..7427f82 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_51759_prime.crash_dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_51759_prime.crash_dart.intertwined.expect
@@ -25,7 +25,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, x)
+          notEofOrType(CLOSE_CURLY_BRACKET, x)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -49,7 +49,7 @@
                       listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], a, a)
                     rewriter()
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, <)
+          notEofOrType(CLOSE_CURLY_BRACKET, <)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -103,7 +103,7 @@
                         listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], ;, ;)
                       rewriter()
                     listener: handleExpressionStatement(<, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/issue_54284.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/issue_54284.dart.intertwined.expect
index f78c4aa..8513396 100644
--- a/pkg/front_end/parser_testcases/error_recovery/issue_54284.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/issue_54284.dart.intertwined.expect
@@ -28,7 +28,6 @@
                   parseCascadeExpression(0)
                     listener: beginCascade(..)
                     parseSend(.., expressionContinuation, ConstantPatternContext.none)
-                      isNextIdentifier(..)
                       ensureIdentifier(.., expressionContinuation)
                         listener: handleIdentifier(isEven, expressionContinuation)
                       listener: handleNoTypeArguments(;)
@@ -65,7 +64,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
@@ -84,7 +83,7 @@
                     listener: endInitializedIdentifier(x)
                   ensureSemicolon(x)
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, print)
+          notEofOrType(CLOSE_CURLY_BRACKET, print)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -97,7 +96,6 @@
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(print, expression)
                               listener: handleNoTypeArguments(()
@@ -111,7 +109,6 @@
                                           parsePrimary((, expression, ConstantPatternContext.none)
                                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                               parseSend((, expression, ConstantPatternContext.none)
-                                                isNextIdentifier(()
                                                 ensureIdentifier((, expression)
                                                   listener: handleIdentifier(x, expression)
                                                 listener: handleNoTypeArguments(=)
@@ -128,7 +125,6 @@
                                               parseCascadeExpression(0)
                                                 listener: beginCascade(..)
                                                 parseSend(.., expressionContinuation, ConstantPatternContext.none)
-                                                  isNextIdentifier(..)
                                                   ensureIdentifier(.., expressionContinuation)
                                                     listener: handleIdentifier(isEven, expressionContinuation)
                                                   listener: handleNoTypeArguments())
@@ -144,7 +140,7 @@
                               listener: handleSend(print, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(print, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -171,7 +167,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(A, DeclarationKind.Class, A)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, var)
+            notEofOrType(CLOSE_CURLY_BRACKET, var)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, A)
               parseMetadataStar({)
                 listener: beginMetadataStar(var)
@@ -188,7 +184,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, null, null, null, var, 1, var, ;)
               listener: endMember()
-            notEofOrValue(}, A)
+            notEofOrType(CLOSE_CURLY_BRACKET, A)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, A)
               parseMetadataStar(;)
                 listener: beginMetadataStar(A)
@@ -220,7 +216,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(=)
@@ -237,7 +232,6 @@
                                   parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                       parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                        isNextIdentifier(.)
                                         ensureIdentifier(., expressionContinuation)
                                           listener: handleIdentifier(isEven, expressionContinuation)
                                         listener: handleNoTypeArguments(;)
@@ -257,7 +251,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, A, (, :, ;)
               listener: endMember()
-            notEofOrValue(}, A)
+            notEofOrType(CLOSE_CURLY_BRACKET, A)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, A)
               parseMetadataStar(;)
                 listener: beginMetadataStar(A)
@@ -292,7 +286,6 @@
                             parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                 parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                  isNextIdentifier(.)
                                   ensureIdentifier(., expressionContinuation)
                                     listener: handleIdentifier(x, expressionContinuation)
                                   listener: handleNoTypeArguments(=)
@@ -310,7 +303,6 @@
                                   parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                       parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                        isNextIdentifier(.)
                                         ensureIdentifier(., expressionContinuation)
                                           listener: handleIdentifier(isEven, expressionContinuation)
                                         listener: handleNoTypeArguments(;)
@@ -330,7 +322,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, A, (, :, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 3, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -357,7 +349,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(A, DeclarationKind.Class, A)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, var)
+            notEofOrType(CLOSE_CURLY_BRACKET, var)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, A)
               parseMetadataStar({)
                 listener: beginMetadataStar(var)
@@ -374,7 +366,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, null, null, null, var, 1, var, ;)
               listener: endMember()
-            notEofOrValue(}, A)
+            notEofOrType(CLOSE_CURLY_BRACKET, A)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, A)
               parseMetadataStar(;)
                 listener: beginMetadataStar(A)
@@ -406,7 +398,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(=)
@@ -430,7 +421,6 @@
                                               parseCascadeExpression(3)
                                                 listener: beginCascade(..)
                                                 parseSend(.., expressionContinuation, ConstantPatternContext.none)
-                                                  isNextIdentifier(..)
                                                   ensureIdentifier(.., expressionContinuation)
                                                     listener: handleIdentifier(isEven, expressionContinuation)
                                                   listener: handleNoTypeArguments())
@@ -454,7 +444,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, A, (, :, ;)
               listener: endMember()
-            notEofOrValue(}, A)
+            notEofOrType(CLOSE_CURLY_BRACKET, A)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, A)
               parseMetadataStar(;)
                 listener: beginMetadataStar(A)
@@ -489,7 +479,6 @@
                             parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                 parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                  isNextIdentifier(.)
                                   ensureIdentifier(., expressionContinuation)
                                     listener: handleIdentifier(x, expressionContinuation)
                                   listener: handleNoTypeArguments(=)
@@ -514,7 +503,6 @@
                                               parseCascadeExpression(4)
                                                 listener: beginCascade(..)
                                                 parseSend(.., expressionContinuation, ConstantPatternContext.none)
-                                                  isNextIdentifier(..)
                                                   ensureIdentifier(.., expressionContinuation)
                                                     listener: handleIdentifier(isEven, expressionContinuation)
                                                   listener: handleNoTypeArguments())
@@ -538,7 +526,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, A, (, :, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 3, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -565,7 +553,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(A, DeclarationKind.Class, A)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, var)
+            notEofOrType(CLOSE_CURLY_BRACKET, var)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, A)
               parseMetadataStar({)
                 listener: beginMetadataStar(var)
@@ -582,7 +570,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, null, null, null, var, 1, var, ;)
               listener: endMember()
-            notEofOrValue(}, A)
+            notEofOrType(CLOSE_CURLY_BRACKET, A)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, A)
               parseMetadataStar(;)
                 listener: beginMetadataStar(A)
@@ -614,7 +602,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(=)
@@ -631,7 +618,6 @@
                                   parseCascadeExpression(5)
                                     listener: beginCascade(..)
                                     parseSend(.., expressionContinuation, ConstantPatternContext.none)
-                                      isNextIdentifier(..)
                                       ensureIdentifier(.., expressionContinuation)
                                         listener: handleIdentifier(isEven, expressionContinuation)
                                       listener: handleNoTypeArguments(;)
@@ -653,7 +639,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, A, (, :, ;)
               listener: endMember()
-            notEofOrValue(}, A)
+            notEofOrType(CLOSE_CURLY_BRACKET, A)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, A)
               parseMetadataStar(;)
                 listener: beginMetadataStar(A)
@@ -688,7 +674,6 @@
                             parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                 parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                  isNextIdentifier(.)
                                   ensureIdentifier(., expressionContinuation)
                                     listener: handleIdentifier(x, expressionContinuation)
                                   listener: handleNoTypeArguments(=)
@@ -706,7 +691,6 @@
                                   parseCascadeExpression(6)
                                     listener: beginCascade(..)
                                     parseSend(.., expressionContinuation, ConstantPatternContext.none)
-                                      isNextIdentifier(..)
                                       ensureIdentifier(.., expressionContinuation)
                                         listener: handleIdentifier(isEven, expressionContinuation)
                                       listener: handleNoTypeArguments(;)
@@ -728,7 +712,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, A, (, :, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 3, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/keyword_named_class_fields.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/keyword_named_class_fields.dart.intertwined.expect
index c2ca90b..19409a5 100644
--- a/pkg/front_end/parser_testcases/error_recovery/keyword_named_class_fields.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/keyword_named_class_fields.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(WrapperClass, DeclarationKind.Class, WrapperClass)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, WrapperClass)
               parseMetadataStar({)
                 listener: beginMetadataStar(int)
@@ -49,7 +49,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -73,7 +73,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -101,7 +101,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -125,7 +125,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -149,7 +149,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -177,7 +177,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -205,7 +205,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -233,7 +233,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -261,7 +261,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -289,7 +289,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -317,7 +317,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -341,7 +341,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -369,7 +369,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -393,7 +393,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -421,7 +421,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -445,7 +445,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -473,7 +473,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -501,7 +501,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -525,7 +525,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -553,7 +553,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -577,7 +577,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -601,7 +601,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -625,7 +625,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -653,7 +653,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -681,7 +681,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -709,7 +709,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -737,7 +737,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -761,7 +761,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -786,7 +786,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -810,7 +810,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -838,7 +838,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -862,7 +862,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -886,7 +886,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -914,7 +914,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -938,7 +938,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -962,7 +962,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -990,7 +990,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -1014,7 +1014,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -1038,7 +1038,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -1062,7 +1062,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -1086,7 +1086,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -1114,7 +1114,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -1142,7 +1142,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -1166,7 +1166,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -1190,7 +1190,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -1215,7 +1215,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -1239,7 +1239,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -1263,7 +1263,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -1287,7 +1287,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -1311,7 +1311,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -1339,7 +1339,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -1367,7 +1367,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -1392,7 +1392,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -1416,7 +1416,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -1440,7 +1440,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -1464,7 +1464,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -1491,7 +1491,7 @@
                     listener: endFieldInitializer(=, 42)
                   listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
                 listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -1519,7 +1519,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -1543,7 +1543,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -1570,7 +1570,7 @@
                     listener: endFieldInitializer(=, 42)
                   listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
                 listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -1598,7 +1598,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -1626,7 +1626,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -1654,7 +1654,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -1678,7 +1678,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -1706,7 +1706,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -1734,7 +1734,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -1762,7 +1762,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -1790,7 +1790,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -1814,7 +1814,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 69, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/keyword_named_class_methods.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/keyword_named_class_methods.dart.intertwined.expect
index bcd3635..312b890 100644
--- a/pkg/front_end/parser_testcases/error_recovery/keyword_named_class_methods.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/keyword_named_class_methods.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(WrapperClass, DeclarationKind.Class, WrapperClass)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, WrapperClass)
               parseMetadataStar({)
                 listener: beginMetadataStar(int)
@@ -66,7 +66,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -79,7 +79,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -111,7 +110,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -124,7 +123,6 @@
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody(+)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(abstract, expression)
@@ -139,7 +137,6 @@
                                                 parsePrimary((, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                     parseSend((, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(()
                                                       ensureIdentifier((, expression)
                                                         listener: handleIdentifier(x, expression)
                                                       listener: handleNoTypeArguments(-)
@@ -165,11 +162,11 @@
                         ensureSemicolon(1)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -210,7 +207,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -223,7 +220,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -255,7 +251,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -268,7 +264,6 @@
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody(+)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(as, expression)
@@ -283,7 +278,6 @@
                                                 parsePrimary((, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                     parseSend((, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(()
                                                       ensureIdentifier((, expression)
                                                         listener: handleIdentifier(x, expression)
                                                       listener: handleNoTypeArguments(-)
@@ -309,11 +303,11 @@
                         ensureSemicolon(1)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -358,7 +352,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -371,7 +365,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -403,7 +396,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -421,7 +414,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(x, expression)
                                               listener: handleNoTypeArguments(-)
@@ -448,11 +440,11 @@
                         ensureSemicolon(1)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -493,7 +485,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -506,7 +498,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -538,7 +529,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -551,7 +542,6 @@
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody(+)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(async, expression)
@@ -566,7 +556,6 @@
                                                 parsePrimary((, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                     parseSend((, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(()
                                                       ensureIdentifier((, expression)
                                                         listener: handleIdentifier(x, expression)
                                                       listener: handleNoTypeArguments(-)
@@ -592,11 +581,11 @@
                         ensureSemicolon(1)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -637,7 +626,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -650,7 +639,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -682,7 +670,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -698,7 +686,6 @@
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody(+)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(await, expression)
@@ -713,7 +700,6 @@
                                                 parsePrimary((, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                     parseSend((, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(()
                                                       ensureIdentifier((, expression)
                                                         listener: handleIdentifier(x, expression)
                                                       listener: handleNoTypeArguments(-)
@@ -739,11 +725,11 @@
                         ensureSemicolon(1)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -788,7 +774,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -801,7 +787,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -833,7 +818,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -844,7 +829,6 @@
                               parsePrimary(return, expression, ConstantPatternContext.none)
                                 inPlainSync()
                                 parseSend(return, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(return)
                                   ensureIdentifier(return, expression)
                                     reportRecoverableErrorWithToken(break, Template(ExpectedIdentifier))
                                       listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got 'break'., Try inserting an identifier before 'break'., {lexeme: break}], break, break)
@@ -860,7 +844,7 @@
                           rewriter()
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, break)
+                  notEofOrType(CLOSE_CURLY_BRACKET, break)
                   parseStatement(;)
                     parseStatementX(;)
                       parseBreakStatement(;)
@@ -872,7 +856,7 @@
                             listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], break, break)
                           rewriter()
                         listener: handleBreakStatement(false, break, ;)
-                  notEofOrValue(}, ()
+                  notEofOrType(CLOSE_CURLY_BRACKET, ()
                   parseStatement(;)
                     parseStatementX(;)
                       parseExpressionStatementOrDeclaration(;, null)
@@ -892,7 +876,6 @@
                                               parsePrimary((, expression, ConstantPatternContext.none)
                                                 parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                   parseSend((, expression, ConstantPatternContext.none)
-                                                    isNextIdentifier(()
                                                     ensureIdentifier((, expression)
                                                       listener: handleIdentifier(x, expression)
                                                     listener: handleNoTypeArguments(-)
@@ -917,11 +900,11 @@
                                 listener: endBinaryExpression(+, 1)
                             ensureSemicolon(1)
                             listener: handleExpressionStatement((, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(4, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -966,7 +949,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -979,7 +962,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -1011,7 +993,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -1022,7 +1004,6 @@
                               parsePrimary(return, expression, ConstantPatternContext.none)
                                 inPlainSync()
                                 parseSend(return, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(return)
                                   ensureIdentifier(return, expression)
                                     reportRecoverableErrorWithToken(case, Template(ExpectedIdentifierButGotKeyword))
                                       listener: handleRecoverableError(Message[ExpectedIdentifierButGotKeyword, 'case' can't be used as an identifier because it's a keyword., Try renaming this to be an identifier that isn't a keyword., {lexeme: case}], case, case)
@@ -1038,7 +1019,6 @@
                                               parsePrimary((, expression, ConstantPatternContext.none)
                                                 parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                   parseSend((, expression, ConstantPatternContext.none)
-                                                    isNextIdentifier(()
                                                     ensureIdentifier((, expression)
                                                       listener: handleIdentifier(x, expression)
                                                     listener: handleNoTypeArguments(-)
@@ -1064,11 +1044,11 @@
                         ensureSemicolon(1)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -1113,7 +1093,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -1126,7 +1106,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -1158,7 +1137,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -1169,7 +1148,6 @@
                               parsePrimary(return, expression, ConstantPatternContext.none)
                                 inPlainSync()
                                 parseSend(return, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(return)
                                   ensureIdentifier(return, expression)
                                     reportRecoverableErrorWithToken(catch, Template(ExpectedIdentifierButGotKeyword))
                                       listener: handleRecoverableError(Message[ExpectedIdentifierButGotKeyword, 'catch' can't be used as an identifier because it's a keyword., Try renaming this to be an identifier that isn't a keyword., {lexeme: catch}], catch, catch)
@@ -1185,7 +1163,6 @@
                                               parsePrimary((, expression, ConstantPatternContext.none)
                                                 parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                   parseSend((, expression, ConstantPatternContext.none)
-                                                    isNextIdentifier(()
                                                     ensureIdentifier((, expression)
                                                       listener: handleIdentifier(x, expression)
                                                     listener: handleNoTypeArguments(-)
@@ -1211,11 +1188,11 @@
                         ensureSemicolon(1)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -1260,7 +1237,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -1273,7 +1250,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -1305,7 +1281,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -1316,7 +1292,6 @@
                               parsePrimary(return, expression, ConstantPatternContext.none)
                                 inPlainSync()
                                 parseSend(return, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(return)
                                   ensureIdentifier(return, expression)
                                     reportRecoverableErrorWithToken(class, Template(ExpectedIdentifierButGotKeyword))
                                       listener: handleRecoverableError(Message[ExpectedIdentifierButGotKeyword, 'class' can't be used as an identifier because it's a keyword., Try renaming this to be an identifier that isn't a keyword., {lexeme: class}], class, class)
@@ -1332,7 +1307,6 @@
                                               parsePrimary((, expression, ConstantPatternContext.none)
                                                 parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                   parseSend((, expression, ConstantPatternContext.none)
-                                                    isNextIdentifier(()
                                                     ensureIdentifier((, expression)
                                                       listener: handleIdentifier(x, expression)
                                                     listener: handleNoTypeArguments(-)
@@ -1358,11 +1332,11 @@
                         ensureSemicolon(1)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -1407,7 +1381,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -1420,7 +1394,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -1452,7 +1425,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -1471,7 +1444,6 @@
                                           parsePrimary((, expression, ConstantPatternContext.none)
                                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                               parseSend((, expression, ConstantPatternContext.none)
-                                                isNextIdentifier(()
                                                 ensureIdentifier((, expression)
                                                   listener: handleIdentifier(x, expression)
                                                 listener: handleNoTypeArguments(-)
@@ -1500,11 +1472,11 @@
                         ensureSemicolon(1)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -1549,7 +1521,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -1562,7 +1534,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -1594,7 +1565,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -1605,7 +1576,6 @@
                               parsePrimary(return, expression, ConstantPatternContext.none)
                                 inPlainSync()
                                 parseSend(return, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(return)
                                   ensureIdentifier(return, expression)
                                     reportRecoverableErrorWithToken(continue, Template(ExpectedIdentifier))
                                       listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got 'continue'., Try inserting an identifier before 'continue'., {lexeme: continue}], continue, continue)
@@ -1621,7 +1591,7 @@
                           rewriter()
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, continue)
+                  notEofOrType(CLOSE_CURLY_BRACKET, continue)
                   parseStatement(;)
                     parseStatementX(;)
                       parseContinueStatement(;)
@@ -1633,7 +1603,7 @@
                             listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], continue, continue)
                           rewriter()
                         listener: handleContinueStatement(false, continue, ;)
-                  notEofOrValue(}, ()
+                  notEofOrType(CLOSE_CURLY_BRACKET, ()
                   parseStatement(;)
                     parseStatementX(;)
                       parseExpressionStatementOrDeclaration(;, null)
@@ -1653,7 +1623,6 @@
                                               parsePrimary((, expression, ConstantPatternContext.none)
                                                 parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                   parseSend((, expression, ConstantPatternContext.none)
-                                                    isNextIdentifier(()
                                                     ensureIdentifier((, expression)
                                                       listener: handleIdentifier(x, expression)
                                                     listener: handleNoTypeArguments(-)
@@ -1678,11 +1647,11 @@
                                 listener: endBinaryExpression(+, 1)
                             ensureSemicolon(1)
                             listener: handleExpressionStatement((, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(4, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -1723,7 +1692,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -1736,7 +1705,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -1768,7 +1736,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -1781,7 +1749,6 @@
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody(+)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(covariant, expression)
@@ -1796,7 +1763,6 @@
                                                 parsePrimary((, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                     parseSend((, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(()
                                                       ensureIdentifier((, expression)
                                                         listener: handleIdentifier(x, expression)
                                                       listener: handleNoTypeArguments(-)
@@ -1822,11 +1788,11 @@
                         ensureSemicolon(1)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -1871,7 +1837,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -1884,7 +1850,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -1916,7 +1881,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -1927,7 +1892,6 @@
                               parsePrimary(return, expression, ConstantPatternContext.none)
                                 inPlainSync()
                                 parseSend(return, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(return)
                                   ensureIdentifier(return, expression)
                                     reportRecoverableErrorWithToken(default, Template(ExpectedIdentifierButGotKeyword))
                                       listener: handleRecoverableError(Message[ExpectedIdentifierButGotKeyword, 'default' can't be used as an identifier because it's a keyword., Try renaming this to be an identifier that isn't a keyword., {lexeme: default}], default, default)
@@ -1943,7 +1907,6 @@
                                               parsePrimary((, expression, ConstantPatternContext.none)
                                                 parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                   parseSend((, expression, ConstantPatternContext.none)
-                                                    isNextIdentifier(()
                                                     ensureIdentifier((, expression)
                                                       listener: handleIdentifier(x, expression)
                                                     listener: handleNoTypeArguments(-)
@@ -1969,11 +1932,11 @@
                         ensureSemicolon(1)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -2014,7 +1977,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -2027,7 +1990,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -2059,7 +2021,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -2072,7 +2034,6 @@
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody(+)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(deferred, expression)
@@ -2087,7 +2048,6 @@
                                                 parsePrimary((, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                     parseSend((, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(()
                                                       ensureIdentifier((, expression)
                                                         listener: handleIdentifier(x, expression)
                                                       listener: handleNoTypeArguments(-)
@@ -2113,11 +2073,11 @@
                         ensureSemicolon(1)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -2162,7 +2122,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -2175,7 +2135,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -2207,7 +2166,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -2218,7 +2177,6 @@
                               parsePrimary(return, expression, ConstantPatternContext.none)
                                 inPlainSync()
                                 parseSend(return, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(return)
                                   ensureIdentifier(return, expression)
                                     reportRecoverableErrorWithToken(do, Template(ExpectedIdentifier))
                                       listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got 'do'., Try inserting an identifier before 'do'., {lexeme: do}], do, do)
@@ -2234,7 +2192,7 @@
                           rewriter()
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, do)
+                  notEofOrType(CLOSE_CURLY_BRACKET, do)
                   parseStatement(;)
                     parseStatementX(;)
                       parseDoWhileStatement(;)
@@ -2259,7 +2217,6 @@
                                                     parsePrimary((, expression, ConstantPatternContext.none)
                                                       parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                         parseSend((, expression, ConstantPatternContext.none)
-                                                          isNextIdentifier(()
                                                           ensureIdentifier((, expression)
                                                             listener: handleIdentifier(x, expression)
                                                           listener: handleNoTypeArguments(-)
@@ -2298,7 +2255,6 @@
                                 parseUnaryExpression((, true, ConstantPatternContext.none)
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSend((, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(()
                                       ensureIdentifier((, expression)
                                         reportRecoverableErrorWithToken(), Template(ExpectedIdentifier))
                                           listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got '}'., Try inserting an identifier before '}'., {lexeme: }}], }, })
@@ -2315,11 +2271,11 @@
                             listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], ;, ;)
                           rewriter()
                         listener: endDoWhileStatement(do, while, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(3, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -2360,7 +2316,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -2373,7 +2329,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -2405,7 +2360,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -2418,7 +2373,6 @@
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody(+)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(dynamic, expression)
@@ -2433,7 +2387,6 @@
                                                 parsePrimary((, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                     parseSend((, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(()
                                                       ensureIdentifier((, expression)
                                                         listener: handleIdentifier(x, expression)
                                                       listener: handleNoTypeArguments(-)
@@ -2459,11 +2412,11 @@
                         ensureSemicolon(1)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -2508,7 +2461,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -2521,7 +2474,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -2553,7 +2505,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -2564,7 +2516,6 @@
                               parsePrimary(return, expression, ConstantPatternContext.none)
                                 inPlainSync()
                                 parseSend(return, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(return)
                                   ensureIdentifier(return, expression)
                                     reportRecoverableErrorWithToken(else, Template(ExpectedIdentifier))
                                       listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got 'else'., Try inserting an identifier before 'else'., {lexeme: else}], else, else)
@@ -2580,7 +2531,7 @@
                           rewriter()
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, else)
+                  notEofOrType(CLOSE_CURLY_BRACKET, else)
                   parseStatement(;)
                     parseStatementX(;)
                       parseExpressionStatementOrDeclaration(;, null)
@@ -2593,7 +2544,6 @@
                                   parsePrimary(;, expression, ConstantPatternContext.none)
                                     inPlainSync()
                                     parseSend(;, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(;)
                                       ensureIdentifier(;, expression)
                                         reportRecoverableErrorWithToken(else, Template(ExpectedIdentifier))
                                           listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got 'else'., Try inserting an identifier before 'else'., {lexeme: else}], else, else)
@@ -2610,7 +2560,7 @@
                             listener: handleExpressionStatement(else, ;)
                   reportRecoverableError(;, Message[UnexpectedToken, Unexpected token ';'., null, {lexeme: ;}])
                     listener: handleRecoverableError(Message[UnexpectedToken, Unexpected token ';'., null, {lexeme: ;}], else, else)
-                  notEofOrValue(}, ()
+                  notEofOrType(CLOSE_CURLY_BRACKET, ()
                   parseStatement(else)
                     parseStatementX(else)
                       parseExpressionStatementOrDeclaration(else, null)
@@ -2630,7 +2580,6 @@
                                               parsePrimary((, expression, ConstantPatternContext.none)
                                                 parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                   parseSend((, expression, ConstantPatternContext.none)
-                                                    isNextIdentifier(()
                                                     ensureIdentifier((, expression)
                                                       listener: handleIdentifier(x, expression)
                                                     listener: handleNoTypeArguments(-)
@@ -2655,11 +2604,11 @@
                                 listener: endBinaryExpression(+, 1)
                             ensureSemicolon(1)
                             listener: handleExpressionStatement((, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(4, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -2704,7 +2653,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -2717,7 +2666,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -2749,7 +2697,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -2760,7 +2708,6 @@
                               parsePrimary(return, expression, ConstantPatternContext.none)
                                 inPlainSync()
                                 parseSend(return, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(return)
                                   ensureIdentifier(return, expression)
                                     reportRecoverableErrorWithToken(enum, Template(ExpectedIdentifierButGotKeyword))
                                       listener: handleRecoverableError(Message[ExpectedIdentifierButGotKeyword, 'enum' can't be used as an identifier because it's a keyword., Try renaming this to be an identifier that isn't a keyword., {lexeme: enum}], enum, enum)
@@ -2776,7 +2723,6 @@
                                               parsePrimary((, expression, ConstantPatternContext.none)
                                                 parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                   parseSend((, expression, ConstantPatternContext.none)
-                                                    isNextIdentifier(()
                                                     ensureIdentifier((, expression)
                                                       listener: handleIdentifier(x, expression)
                                                     listener: handleNoTypeArguments(-)
@@ -2802,11 +2748,11 @@
                         ensureSemicolon(1)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -2847,7 +2793,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -2860,7 +2806,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -2892,7 +2837,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -2905,7 +2850,6 @@
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody(+)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(export, expression)
@@ -2920,7 +2864,6 @@
                                                 parsePrimary((, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                     parseSend((, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(()
                                                       ensureIdentifier((, expression)
                                                         listener: handleIdentifier(x, expression)
                                                       listener: handleNoTypeArguments(-)
@@ -2946,11 +2889,11 @@
                         ensureSemicolon(1)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -2995,7 +2938,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -3008,7 +2951,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -3040,7 +2982,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -3051,7 +2993,6 @@
                               parsePrimary(return, expression, ConstantPatternContext.none)
                                 inPlainSync()
                                 parseSend(return, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(return)
                                   ensureIdentifier(return, expression)
                                     reportRecoverableErrorWithToken(extends, Template(ExpectedIdentifierButGotKeyword))
                                       listener: handleRecoverableError(Message[ExpectedIdentifierButGotKeyword, 'extends' can't be used as an identifier because it's a keyword., Try renaming this to be an identifier that isn't a keyword., {lexeme: extends}], extends, extends)
@@ -3067,7 +3008,6 @@
                                               parsePrimary((, expression, ConstantPatternContext.none)
                                                 parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                   parseSend((, expression, ConstantPatternContext.none)
-                                                    isNextIdentifier(()
                                                     ensureIdentifier((, expression)
                                                       listener: handleIdentifier(x, expression)
                                                     listener: handleNoTypeArguments(-)
@@ -3093,11 +3033,11 @@
                         ensureSemicolon(1)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -3138,7 +3078,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -3151,7 +3091,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -3183,7 +3122,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -3196,7 +3135,6 @@
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody(+)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(extension, expression)
@@ -3211,7 +3149,6 @@
                                                 parsePrimary((, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                     parseSend((, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(()
                                                       ensureIdentifier((, expression)
                                                         listener: handleIdentifier(x, expression)
                                                       listener: handleNoTypeArguments(-)
@@ -3237,11 +3174,11 @@
                         ensureSemicolon(1)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -3282,7 +3219,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -3295,7 +3232,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -3327,7 +3263,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -3340,7 +3276,6 @@
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody(+)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(external, expression)
@@ -3355,7 +3290,6 @@
                                                 parsePrimary((, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                     parseSend((, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(()
                                                       ensureIdentifier((, expression)
                                                         listener: handleIdentifier(x, expression)
                                                       listener: handleNoTypeArguments(-)
@@ -3381,11 +3315,11 @@
                         ensureSemicolon(1)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -3426,7 +3360,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -3439,7 +3373,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -3471,7 +3404,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -3484,7 +3417,6 @@
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody(+)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(factory, expression)
@@ -3499,7 +3431,6 @@
                                                 parsePrimary((, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                     parseSend((, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(()
                                                       ensureIdentifier((, expression)
                                                         listener: handleIdentifier(x, expression)
                                                       listener: handleNoTypeArguments(-)
@@ -3525,11 +3456,11 @@
                         ensureSemicolon(1)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -3574,7 +3505,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -3587,7 +3518,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -3619,7 +3549,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -3641,7 +3571,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(x, expression)
                                               listener: handleNoTypeArguments(-)
@@ -3667,11 +3596,11 @@
                         ensureSemicolon(1)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -3716,7 +3645,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -3729,7 +3658,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -3761,7 +3689,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -3772,7 +3700,6 @@
                               parsePrimary(return, expression, ConstantPatternContext.none)
                                 inPlainSync()
                                 parseSend(return, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(return)
                                   ensureIdentifier(return, expression)
                                     reportRecoverableErrorWithToken(final, Template(ExpectedIdentifier))
                                       listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got 'final'., Try inserting an identifier before 'final'., {lexeme: final}], final, final)
@@ -3788,7 +3715,7 @@
                           rewriter()
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, final)
+                  notEofOrType(CLOSE_CURLY_BRACKET, final)
                   parseStatement(;)
                     parseStatementX(;)
                       parseExpressionStatementOrDeclarationAfterModifiers(final, ;, null, final, null, null)
@@ -3813,7 +3740,7 @@
                               listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], (, ()
                             rewriter()
                           listener: endVariablesDeclaration(1, ;)
-                  notEofOrValue(}, x)
+                  notEofOrType(CLOSE_CURLY_BRACKET, x)
                   parseStatement(;)
                     parseStatementX(;)
                       parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -3825,7 +3752,6 @@
                                 parsePrimary(;, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                                     parseSend(;, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(;)
                                       ensureIdentifier(;, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments(-)
@@ -3844,7 +3770,7 @@
                               listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], 1, 1)
                             rewriter()
                           listener: handleExpressionStatement(x, ;)
-                  notEofOrValue(}, ))
+                  notEofOrType(CLOSE_CURLY_BRACKET, ))
                   parseStatement(;)
                     parseStatementX(;)
                       parseExpressionStatementOrDeclaration(;, null)
@@ -3856,7 +3782,6 @@
                                 parseUnaryExpression(;, true, ConstantPatternContext.none)
                                   parsePrimary(;, expression, ConstantPatternContext.none)
                                     parseSend(;, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(;)
                                       ensureIdentifier(;, expression)
                                         reportRecoverableErrorWithToken(), Template(ExpectedIdentifier))
                                           listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got ')'., Try inserting an identifier before ')'., {lexeme: )}], ), ))
@@ -3873,7 +3798,7 @@
                             listener: handleExpressionStatement(), ;)
                   reportRecoverableError(;, Message[UnexpectedToken, Unexpected token ';'., null, {lexeme: ;}])
                     listener: handleRecoverableError(Message[UnexpectedToken, Unexpected token ';'., null, {lexeme: ;}], ), ))
-                  notEofOrValue(}, +)
+                  notEofOrType(CLOSE_CURLY_BRACKET, +)
                   parseStatement())
                     parseStatementX())
                       parseExpressionStatementOrDeclaration(), null)
@@ -3890,7 +3815,6 @@
                                   parsePrimary(), expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(), expression, ConstantPatternContext.none)
                                       parseSend(), expression, ConstantPatternContext.none)
-                                        isNextIdentifier())
                                         ensureIdentifier(), expression)
                                           listener: handleIdentifier(, expression)
                                         listener: handleNoTypeArguments(+)
@@ -3906,11 +3830,11 @@
                                 listener: endBinaryExpression(+, 1)
                             ensureSemicolon(1)
                             listener: handleExpressionStatement(+, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(6, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -3955,7 +3879,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -3968,7 +3892,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -4000,7 +3923,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -4011,7 +3934,6 @@
                               parsePrimary(return, expression, ConstantPatternContext.none)
                                 inPlainSync()
                                 parseSend(return, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(return)
                                   ensureIdentifier(return, expression)
                                     reportRecoverableErrorWithToken(finally, Template(ExpectedIdentifierButGotKeyword))
                                       listener: handleRecoverableError(Message[ExpectedIdentifierButGotKeyword, 'finally' can't be used as an identifier because it's a keyword., Try renaming this to be an identifier that isn't a keyword., {lexeme: finally}], finally, finally)
@@ -4027,7 +3949,6 @@
                                               parsePrimary((, expression, ConstantPatternContext.none)
                                                 parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                   parseSend((, expression, ConstantPatternContext.none)
-                                                    isNextIdentifier(()
                                                     ensureIdentifier((, expression)
                                                       listener: handleIdentifier(x, expression)
                                                     listener: handleNoTypeArguments(-)
@@ -4053,11 +3974,11 @@
                         ensureSemicolon(1)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -4102,7 +4023,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -4115,7 +4036,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -4147,7 +4067,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -4158,7 +4078,6 @@
                               parsePrimary(return, expression, ConstantPatternContext.none)
                                 inPlainSync()
                                 parseSend(return, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(return)
                                   ensureIdentifier(return, expression)
                                     reportRecoverableErrorWithToken(for, Template(ExpectedIdentifier))
                                       listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got 'for'., Try inserting an identifier before 'for'., {lexeme: for}], for, for)
@@ -4174,7 +4093,7 @@
                           rewriter()
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, for)
+                  notEofOrType(CLOSE_CURLY_BRACKET, for)
                   parseStatement(;)
                     parseStatementX(;)
                       parseForStatement(;, null)
@@ -4189,7 +4108,6 @@
                                 parsePrimary((, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                     parseSend((, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(()
                                       ensureIdentifier((, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments(-)
@@ -4216,7 +4134,6 @@
                                   parseUnaryExpression(;, true, ConstantPatternContext.none)
                                     parsePrimary(;, expression, ConstantPatternContext.none)
                                       parseSend(;, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(;)
                                         ensureIdentifier(;, expression)
                                           reportRecoverableErrorWithToken(), Template(ExpectedIdentifier))
                                             listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got ')'., Try inserting an identifier before ')'., {lexeme: )}], ), ))
@@ -4249,7 +4166,6 @@
                                           parsePrimary(), expression, ConstantPatternContext.none)
                                             parseSendOrFunctionLiteral(), expression, ConstantPatternContext.none)
                                               parseSend(), expression, ConstantPatternContext.none)
-                                                isNextIdentifier())
                                                 ensureIdentifier(), expression)
                                                   listener: handleIdentifier(, expression)
                                                 listener: handleNoTypeArguments(+)
@@ -4267,11 +4183,11 @@
                                     listener: handleExpressionStatement(+, ;)
                           listener: endForStatementBody(;)
                           listener: endForStatement(;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(3, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -4312,7 +4228,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -4325,7 +4241,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -4357,7 +4272,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -4370,7 +4285,6 @@
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody(+)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(Function, expression)
@@ -4385,7 +4299,6 @@
                                                 parsePrimary((, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                     parseSend((, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(()
                                                       ensureIdentifier((, expression)
                                                         listener: handleIdentifier(x, expression)
                                                       listener: handleNoTypeArguments(-)
@@ -4411,11 +4324,11 @@
                         ensureSemicolon(1)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -4457,7 +4370,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -4470,7 +4383,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -4502,7 +4414,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -4515,7 +4427,6 @@
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody(+)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(get, expression)
@@ -4530,7 +4441,6 @@
                                                 parsePrimary((, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                     parseSend((, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(()
                                                       ensureIdentifier((, expression)
                                                         listener: handleIdentifier(x, expression)
                                                       listener: handleNoTypeArguments(-)
@@ -4556,11 +4466,11 @@
                         ensureSemicolon(1)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -4601,7 +4511,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -4614,7 +4524,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -4646,7 +4555,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -4659,7 +4568,6 @@
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody(+)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(hide, expression)
@@ -4674,7 +4582,6 @@
                                                 parsePrimary((, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                     parseSend((, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(()
                                                       ensureIdentifier((, expression)
                                                         listener: handleIdentifier(x, expression)
                                                       listener: handleNoTypeArguments(-)
@@ -4700,11 +4607,11 @@
                         ensureSemicolon(1)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -4749,7 +4656,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -4762,7 +4669,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -4794,7 +4700,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -4805,7 +4711,6 @@
                               parsePrimary(return, expression, ConstantPatternContext.none)
                                 inPlainSync()
                                 parseSend(return, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(return)
                                   ensureIdentifier(return, expression)
                                     reportRecoverableErrorWithToken(if, Template(ExpectedIdentifier))
                                       listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got 'if'., Try inserting an identifier before 'if'., {lexeme: if}], if, if)
@@ -4821,7 +4726,7 @@
                           rewriter()
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement(;)
                     parseStatementX(;)
                       parseIfStatement(;)
@@ -4834,7 +4739,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(-)
@@ -4867,7 +4771,6 @@
                                         parsePrimary(), expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral(), expression, ConstantPatternContext.none)
                                             parseSend(), expression, ConstantPatternContext.none)
-                                              isNextIdentifier())
                                               ensureIdentifier(), expression)
                                                 listener: handleIdentifier(, expression)
                                               listener: handleNoTypeArguments(+)
@@ -4885,11 +4788,11 @@
                                   listener: handleExpressionStatement(+, ;)
                         listener: endThenStatement(+, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(3, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -4930,7 +4833,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -4943,7 +4846,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -4975,7 +4877,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -4988,7 +4890,6 @@
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody(+)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(implements, expression)
@@ -5003,7 +4904,6 @@
                                                 parsePrimary((, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                     parseSend((, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(()
                                                       ensureIdentifier((, expression)
                                                         listener: handleIdentifier(x, expression)
                                                       listener: handleNoTypeArguments(-)
@@ -5029,11 +4929,11 @@
                         ensureSemicolon(1)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -5074,7 +4974,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -5087,7 +4987,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -5119,7 +5018,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -5132,7 +5031,6 @@
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody(+)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(import, expression)
@@ -5147,7 +5045,6 @@
                                                 parsePrimary((, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                     parseSend((, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(()
                                                       ensureIdentifier((, expression)
                                                         listener: handleIdentifier(x, expression)
                                                       listener: handleNoTypeArguments(-)
@@ -5173,11 +5070,11 @@
                         ensureSemicolon(1)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -5222,7 +5119,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -5235,7 +5132,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -5267,7 +5163,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -5278,7 +5174,6 @@
                               parsePrimary(return, expression, ConstantPatternContext.none)
                                 inPlainSync()
                                 parseSend(return, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(return)
                                   ensureIdentifier(return, expression)
                                     reportRecoverableErrorWithToken(in, Template(ExpectedIdentifierButGotKeyword))
                                       listener: handleRecoverableError(Message[ExpectedIdentifierButGotKeyword, 'in' can't be used as an identifier because it's a keyword., Try renaming this to be an identifier that isn't a keyword., {lexeme: in}], in, in)
@@ -5294,7 +5189,6 @@
                                               parsePrimary((, expression, ConstantPatternContext.none)
                                                 parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                   parseSend((, expression, ConstantPatternContext.none)
-                                                    isNextIdentifier(()
                                                     ensureIdentifier((, expression)
                                                       listener: handleIdentifier(x, expression)
                                                     listener: handleNoTypeArguments(-)
@@ -5320,11 +5214,11 @@
                         ensureSemicolon(1)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -5365,7 +5259,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -5378,7 +5272,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -5410,7 +5303,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -5423,7 +5316,6 @@
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody(+)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(inout, expression)
@@ -5438,7 +5330,6 @@
                                                 parsePrimary((, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                     parseSend((, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(()
                                                       ensureIdentifier((, expression)
                                                         listener: handleIdentifier(x, expression)
                                                       listener: handleNoTypeArguments(-)
@@ -5464,11 +5355,11 @@
                         ensureSemicolon(1)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -5509,7 +5400,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -5522,7 +5413,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -5554,7 +5444,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -5567,7 +5457,6 @@
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody(+)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(interface, expression)
@@ -5582,7 +5471,6 @@
                                                 parsePrimary((, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                     parseSend((, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(()
                                                       ensureIdentifier((, expression)
                                                         listener: handleIdentifier(x, expression)
                                                       listener: handleNoTypeArguments(-)
@@ -5608,11 +5496,11 @@
                         ensureSemicolon(1)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -5657,7 +5545,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -5670,7 +5558,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -5702,7 +5589,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -5713,7 +5600,6 @@
                               parsePrimary(return, expression, ConstantPatternContext.none)
                                 inPlainSync()
                                 parseSend(return, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(return)
                                   ensureIdentifier(return, expression)
                                     reportRecoverableErrorWithToken(is, Template(ExpectedIdentifier))
                                       listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got 'is'., Try inserting an identifier before 'is'., {lexeme: is}], is, is)
@@ -5753,7 +5639,7 @@
                           rewriter()
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, +)
+                  notEofOrType(CLOSE_CURLY_BRACKET, +)
                   parseStatement(;)
                     parseStatementX(;)
                       parseExpressionStatementOrDeclaration(;, null)
@@ -5770,7 +5656,6 @@
                                   parsePrimary(;, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                                       parseSend(;, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(;)
                                         ensureIdentifier(;, expression)
                                           listener: handleIdentifier(, expression)
                                         listener: handleNoTypeArguments(+)
@@ -5786,11 +5671,11 @@
                                 listener: endBinaryExpression(+, 1)
                             ensureSemicolon(1)
                             listener: handleExpressionStatement(+, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(3, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -5831,7 +5716,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -5844,7 +5729,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -5876,7 +5760,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -5889,7 +5773,6 @@
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody(+)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(late, expression)
@@ -5904,7 +5787,6 @@
                                                 parsePrimary((, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                     parseSend((, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(()
                                                       ensureIdentifier((, expression)
                                                         listener: handleIdentifier(x, expression)
                                                       listener: handleNoTypeArguments(-)
@@ -5930,11 +5812,11 @@
                         ensureSemicolon(1)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -5975,7 +5857,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -5988,7 +5870,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -6020,7 +5901,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -6033,7 +5914,6 @@
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody(+)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(library, expression)
@@ -6048,7 +5928,6 @@
                                                 parsePrimary((, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                     parseSend((, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(()
                                                       ensureIdentifier((, expression)
                                                         listener: handleIdentifier(x, expression)
                                                       listener: handleNoTypeArguments(-)
@@ -6074,11 +5953,11 @@
                         ensureSemicolon(1)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -6119,7 +5998,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -6132,7 +6011,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -6164,7 +6042,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -6177,7 +6055,6 @@
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody(+)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(mixin, expression)
@@ -6192,7 +6069,6 @@
                                                 parsePrimary((, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                     parseSend((, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(()
                                                       ensureIdentifier((, expression)
                                                         listener: handleIdentifier(x, expression)
                                                       listener: handleNoTypeArguments(-)
@@ -6218,11 +6094,11 @@
                         ensureSemicolon(1)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -6263,7 +6139,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -6276,7 +6152,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -6308,7 +6183,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -6321,7 +6196,6 @@
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody(+)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(native, expression)
@@ -6336,7 +6210,6 @@
                                                 parsePrimary((, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                     parseSend((, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(()
                                                       ensureIdentifier((, expression)
                                                         listener: handleIdentifier(x, expression)
                                                       listener: handleNoTypeArguments(-)
@@ -6362,11 +6235,11 @@
                         ensureSemicolon(1)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -6411,7 +6284,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -6424,7 +6297,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -6456,7 +6328,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -6466,7 +6338,6 @@
                             parseUnaryExpression(return, true, ConstantPatternContext.none)
                               parsePrimary(return, expression, ConstantPatternContext.none)
                                 parseNewExpression(return)
-                                  isNextIdentifier(new)
                                   listener: beginNewExpression(new)
                                   parseConstructorReference(new, ConstructorReferenceContext.New, null)
                                     ensureIdentifier(new, constructorReference)
@@ -6489,7 +6360,6 @@
                                             parsePrimary((, expression, ConstantPatternContext.none)
                                               parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                 parseSend((, expression, ConstantPatternContext.none)
-                                                  isNextIdentifier(()
                                                   ensureIdentifier((, expression)
                                                     listener: handleIdentifier(x, expression)
                                                   listener: handleNoTypeArguments(-)
@@ -6515,11 +6385,11 @@
                         ensureSemicolon(1)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -6564,7 +6434,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -6577,7 +6447,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -6609,7 +6478,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -6631,7 +6500,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(x, expression)
                                               listener: handleNoTypeArguments(-)
@@ -6657,11 +6525,11 @@
                         ensureSemicolon(1)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -6702,7 +6570,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -6715,7 +6583,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -6747,7 +6614,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -6760,7 +6627,6 @@
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody(+)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(of, expression)
@@ -6775,7 +6641,6 @@
                                                 parsePrimary((, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                     parseSend((, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(()
                                                       ensureIdentifier((, expression)
                                                         listener: handleIdentifier(x, expression)
                                                       listener: handleNoTypeArguments(-)
@@ -6801,11 +6666,11 @@
                         ensureSemicolon(1)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -6846,7 +6711,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -6859,7 +6724,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -6891,7 +6755,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -6904,7 +6768,6 @@
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody(+)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(on, expression)
@@ -6919,7 +6782,6 @@
                                                 parsePrimary((, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                     parseSend((, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(()
                                                       ensureIdentifier((, expression)
                                                         listener: handleIdentifier(x, expression)
                                                       listener: handleNoTypeArguments(-)
@@ -6945,11 +6807,11 @@
                         ensureSemicolon(1)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -6992,7 +6854,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -7005,7 +6867,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -7037,7 +6898,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -7050,7 +6911,6 @@
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody(+)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(operator, expression)
@@ -7065,7 +6925,6 @@
                                                 parsePrimary((, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                     parseSend((, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(()
                                                       ensureIdentifier((, expression)
                                                         listener: handleIdentifier(x, expression)
                                                       listener: handleNoTypeArguments(-)
@@ -7091,11 +6950,11 @@
                         ensureSemicolon(1)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -7136,7 +6995,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -7149,7 +7008,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -7181,7 +7039,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -7194,7 +7052,6 @@
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody(+)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(out, expression)
@@ -7209,7 +7066,6 @@
                                                 parsePrimary((, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                     parseSend((, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(()
                                                       ensureIdentifier((, expression)
                                                         listener: handleIdentifier(x, expression)
                                                       listener: handleNoTypeArguments(-)
@@ -7235,11 +7091,11 @@
                         ensureSemicolon(1)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -7280,7 +7136,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -7293,7 +7149,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -7325,7 +7180,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -7338,7 +7193,6 @@
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody(+)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(part, expression)
@@ -7353,7 +7207,6 @@
                                                 parsePrimary((, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                     parseSend((, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(()
                                                       ensureIdentifier((, expression)
                                                         listener: handleIdentifier(x, expression)
                                                       listener: handleNoTypeArguments(-)
@@ -7379,11 +7232,11 @@
                         ensureSemicolon(1)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -7424,7 +7277,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -7437,7 +7290,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -7469,7 +7321,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -7482,7 +7334,6 @@
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody(+)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(patch, expression)
@@ -7497,7 +7348,6 @@
                                                 parsePrimary((, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                     parseSend((, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(()
                                                       ensureIdentifier((, expression)
                                                         listener: handleIdentifier(x, expression)
                                                       listener: handleNoTypeArguments(-)
@@ -7523,11 +7373,11 @@
                         ensureSemicolon(1)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -7568,7 +7418,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -7581,7 +7431,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -7613,7 +7462,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -7626,7 +7475,6 @@
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody(+)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(required, expression)
@@ -7641,7 +7489,6 @@
                                                 parsePrimary((, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                     parseSend((, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(()
                                                       ensureIdentifier((, expression)
                                                         listener: handleIdentifier(x, expression)
                                                       listener: handleNoTypeArguments(-)
@@ -7667,11 +7514,11 @@
                         ensureSemicolon(1)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -7716,7 +7563,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -7729,7 +7576,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -7761,7 +7607,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -7772,7 +7618,6 @@
                               parsePrimary(return, expression, ConstantPatternContext.none)
                                 inPlainSync()
                                 parseSend(return, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(return)
                                   ensureIdentifier(return, expression)
                                     reportRecoverableErrorWithToken(rethrow, Template(ExpectedIdentifierButGotKeyword))
                                       listener: handleRecoverableError(Message[ExpectedIdentifierButGotKeyword, 'rethrow' can't be used as an identifier because it's a keyword., Try renaming this to be an identifier that isn't a keyword., {lexeme: rethrow}], rethrow, rethrow)
@@ -7788,7 +7633,6 @@
                                               parsePrimary((, expression, ConstantPatternContext.none)
                                                 parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                   parseSend((, expression, ConstantPatternContext.none)
-                                                    isNextIdentifier(()
                                                     ensureIdentifier((, expression)
                                                       listener: handleIdentifier(x, expression)
                                                     listener: handleNoTypeArguments(-)
@@ -7814,11 +7658,11 @@
                         ensureSemicolon(1)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -7863,7 +7707,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -7876,7 +7720,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -7908,7 +7751,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -7930,7 +7773,6 @@
                                             parsePrimary((, expression, ConstantPatternContext.none)
                                               parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                 parseSend((, expression, ConstantPatternContext.none)
-                                                  isNextIdentifier(()
                                                   ensureIdentifier((, expression)
                                                     listener: handleIdentifier(x, expression)
                                                   listener: handleNoTypeArguments(-)
@@ -7956,11 +7798,11 @@
                         ensureSemicolon(1)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -8002,7 +7844,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -8015,7 +7857,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -8047,7 +7888,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -8060,7 +7901,6 @@
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody(+)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(set, expression)
@@ -8075,7 +7915,6 @@
                                                 parsePrimary((, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                     parseSend((, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(()
                                                       ensureIdentifier((, expression)
                                                         listener: handleIdentifier(x, expression)
                                                       listener: handleNoTypeArguments(-)
@@ -8101,11 +7940,11 @@
                         ensureSemicolon(1)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -8146,7 +7985,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -8159,7 +7998,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -8191,7 +8029,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -8204,7 +8042,6 @@
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody(+)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(show, expression)
@@ -8219,7 +8056,6 @@
                                                 parsePrimary((, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                     parseSend((, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(()
                                                       ensureIdentifier((, expression)
                                                         listener: handleIdentifier(x, expression)
                                                       listener: handleNoTypeArguments(-)
@@ -8245,11 +8081,11 @@
                         ensureSemicolon(1)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -8290,7 +8126,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -8303,7 +8139,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -8335,7 +8170,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -8348,7 +8183,6 @@
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody(+)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(source, expression)
@@ -8363,7 +8197,6 @@
                                                 parsePrimary((, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                     parseSend((, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(()
                                                       ensureIdentifier((, expression)
                                                         listener: handleIdentifier(x, expression)
                                                       listener: handleNoTypeArguments(-)
@@ -8389,11 +8222,11 @@
                         ensureSemicolon(1)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -8434,7 +8267,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -8447,7 +8280,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -8479,7 +8311,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -8492,7 +8324,6 @@
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody(+)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(static, expression)
@@ -8507,7 +8338,6 @@
                                                 parsePrimary((, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                     parseSend((, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(()
                                                       ensureIdentifier((, expression)
                                                         listener: handleIdentifier(x, expression)
                                                       listener: handleNoTypeArguments(-)
@@ -8533,11 +8363,11 @@
                         ensureSemicolon(1)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -8561,7 +8391,7 @@
                     rewriter()
                   listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
                 listener: endMember()
-            notEofOrValue(}, ()
+            notEofOrType(CLOSE_CURLY_BRACKET, ()
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(()
@@ -8605,7 +8435,7 @@
                   inPlainSync()
                   parseFunctionBody(), false, true)
                     listener: beginBlockFunctionBody({)
-                    notEofOrValue(}, if)
+                    notEofOrType(CLOSE_CURLY_BRACKET, if)
                     parseStatement({)
                       parseStatementX({)
                         parseIfStatement({)
@@ -8618,7 +8448,6 @@
                                     parsePrimary((, expression, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                         parseSend((, expression, ConstantPatternContext.none)
-                                          isNextIdentifier(()
                                           ensureIdentifier((, expression)
                                             listener: handleIdentifier(x, expression)
                                           listener: handleNoTypeArguments(==)
@@ -8650,7 +8479,7 @@
                                 inGenerator()
                           listener: endThenStatement(return, ;)
                           listener: endIfStatement(if, null, ;)
-                    notEofOrValue(}, return)
+                    notEofOrType(CLOSE_CURLY_BRACKET, return)
                     parseStatement(;)
                       parseStatementX(;)
                         parseReturnStatement(;)
@@ -8671,7 +8500,6 @@
                                               parsePrimary((, expression, ConstantPatternContext.none)
                                                 parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                   parseSend((, expression, ConstantPatternContext.none)
-                                                    isNextIdentifier(()
                                                     ensureIdentifier((, expression)
                                                       listener: handleIdentifier(x, expression)
                                                     listener: handleNoTypeArguments(-)
@@ -8697,11 +8525,11 @@
                           ensureSemicolon(1)
                           listener: endReturnStatement(true, return, ;)
                           inGenerator()
-                    notEofOrValue(}, })
+                    notEofOrType(CLOSE_CURLY_BRACKET, })
                     listener: endBlockFunctionBody(2, {, })
                   listener: endClassMethod(null, , (, null, })
                 listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -8746,7 +8574,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -8759,7 +8587,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -8791,7 +8618,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -8802,7 +8629,6 @@
                               parsePrimary(return, expression, ConstantPatternContext.none)
                                 inPlainSync()
                                 parseSend(return, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(return)
                                   ensureIdentifier(return, expression)
                                     reportRecoverableErrorWithToken(switch, Template(ExpectedIdentifier))
                                       listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got 'switch'., Try inserting an identifier before 'switch'., {lexeme: switch}], switch, switch)
@@ -8818,7 +8644,7 @@
                           rewriter()
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, switch)
+                  notEofOrType(CLOSE_CURLY_BRACKET, switch)
                   parseStatement(;)
                     parseStatementX(;)
                       parseSwitchStatement(;)
@@ -8831,7 +8657,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(-)
@@ -8855,10 +8680,10 @@
                               rewriter()
                               rewriter()
                           listener: beginSwitchBlock({)
-                          notEofOrValue(}, })
+                          notEofOrType(CLOSE_CURLY_BRACKET, })
                           listener: endSwitchBlock(0, {, })
                         listener: endSwitchStatement(switch, })
-                  notEofOrValue(}, +)
+                  notEofOrType(CLOSE_CURLY_BRACKET, +)
                   parseStatement(})
                     parseStatementX(})
                       parseExpressionStatementOrDeclaration(}, null)
@@ -8875,7 +8700,6 @@
                                   parsePrimary(}, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(}, expression, ConstantPatternContext.none)
                                       parseSend(}, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(})
                                         ensureIdentifier(}, expression)
                                           listener: handleIdentifier(, expression)
                                         listener: handleNoTypeArguments(+)
@@ -8891,11 +8715,11 @@
                                 listener: endBinaryExpression(+, 1)
                             ensureSemicolon(1)
                             listener: handleExpressionStatement(+, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(4, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -8936,7 +8760,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -8949,7 +8773,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -8981,7 +8804,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -8994,7 +8817,6 @@
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody(+)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(sync, expression)
@@ -9009,7 +8831,6 @@
                                                 parsePrimary((, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                     parseSend((, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(()
                                                       ensureIdentifier((, expression)
                                                         listener: handleIdentifier(x, expression)
                                                       listener: handleNoTypeArguments(-)
@@ -9035,11 +8856,11 @@
                         ensureSemicolon(1)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -9063,7 +8884,7 @@
                     rewriter()
                   listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
                 listener: endMember()
-            notEofOrValue(}, ()
+            notEofOrType(CLOSE_CURLY_BRACKET, ()
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(()
@@ -9107,7 +8928,7 @@
                   inPlainSync()
                   parseFunctionBody(), false, true)
                     listener: beginBlockFunctionBody({)
-                    notEofOrValue(}, if)
+                    notEofOrType(CLOSE_CURLY_BRACKET, if)
                     parseStatement({)
                       parseStatementX({)
                         parseIfStatement({)
@@ -9120,7 +8941,6 @@
                                     parsePrimary((, expression, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                         parseSend((, expression, ConstantPatternContext.none)
-                                          isNextIdentifier(()
                                           ensureIdentifier((, expression)
                                             listener: handleIdentifier(x, expression)
                                           listener: handleNoTypeArguments(==)
@@ -9152,7 +8972,7 @@
                                 inGenerator()
                           listener: endThenStatement(return, ;)
                           listener: endIfStatement(if, null, ;)
-                    notEofOrValue(}, return)
+                    notEofOrType(CLOSE_CURLY_BRACKET, return)
                     parseStatement(;)
                       parseStatementX(;)
                         parseReturnStatement(;)
@@ -9173,7 +8993,6 @@
                                               parsePrimary((, expression, ConstantPatternContext.none)
                                                 parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                   parseSend((, expression, ConstantPatternContext.none)
-                                                    isNextIdentifier(()
                                                     ensureIdentifier((, expression)
                                                       listener: handleIdentifier(x, expression)
                                                     listener: handleNoTypeArguments(-)
@@ -9199,11 +9018,11 @@
                           ensureSemicolon(1)
                           listener: endReturnStatement(true, return, ;)
                           inGenerator()
-                    notEofOrValue(}, })
+                    notEofOrType(CLOSE_CURLY_BRACKET, })
                     listener: endBlockFunctionBody(2, {, })
                   listener: endClassMethod(null, , (, null, })
                 listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -9248,7 +9067,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -9261,7 +9080,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -9293,7 +9111,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -9313,7 +9131,6 @@
                                               parsePrimary((, expression, ConstantPatternContext.none)
                                                 parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                   parseSend((, expression, ConstantPatternContext.none)
-                                                    isNextIdentifier(()
                                                     ensureIdentifier((, expression)
                                                       listener: handleIdentifier(x, expression)
                                                     listener: handleNoTypeArguments(-)
@@ -9340,11 +9157,11 @@
                         ensureSemicolon(1)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -9389,7 +9206,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -9402,7 +9219,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -9434,7 +9250,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -9456,7 +9272,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(x, expression)
                                               listener: handleNoTypeArguments(-)
@@ -9482,11 +9297,11 @@
                         ensureSemicolon(1)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -9531,7 +9346,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -9544,7 +9359,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -9576,7 +9390,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -9587,7 +9401,6 @@
                               parsePrimary(return, expression, ConstantPatternContext.none)
                                 inPlainSync()
                                 parseSend(return, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(return)
                                   ensureIdentifier(return, expression)
                                     reportRecoverableErrorWithToken(try, Template(ExpectedIdentifier))
                                       listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got 'try'., Try inserting an identifier before 'try'., {lexeme: try}], try, try)
@@ -9603,7 +9416,7 @@
                           rewriter()
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, try)
+                  notEofOrType(CLOSE_CURLY_BRACKET, try)
                   parseStatement(;)
                     parseStatementX(;)
                       parseTryStatement(;)
@@ -9616,12 +9429,12 @@
                               rewriter()
                               rewriter()
                           listener: beginBlock({, BlockKind(try statement))
-                          notEofOrValue(}, })
+                          notEofOrType(CLOSE_CURLY_BRACKET, })
                           listener: endBlock(0, {, }, BlockKind(try statement))
                         reportRecoverableError(try, OnlyTry)
                           listener: handleRecoverableError(OnlyTry, try, try)
                         listener: endTryStatement(0, try, null, })
-                  notEofOrValue(}, ()
+                  notEofOrType(CLOSE_CURLY_BRACKET, ()
                   parseStatement(})
                     parseStatementX(})
                       parseExpressionStatementOrDeclaration(}, null)
@@ -9641,7 +9454,6 @@
                                               parsePrimary((, expression, ConstantPatternContext.none)
                                                 parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                   parseSend((, expression, ConstantPatternContext.none)
-                                                    isNextIdentifier(()
                                                     ensureIdentifier((, expression)
                                                       listener: handleIdentifier(x, expression)
                                                     listener: handleNoTypeArguments(-)
@@ -9666,11 +9478,11 @@
                                 listener: endBinaryExpression(+, 1)
                             ensureSemicolon(1)
                             listener: handleExpressionStatement((, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(4, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -9711,7 +9523,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -9724,7 +9536,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -9756,7 +9567,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -9769,7 +9580,6 @@
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody(+)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(typedef, expression)
@@ -9784,7 +9594,6 @@
                                                 parsePrimary((, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                     parseSend((, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(()
                                                       ensureIdentifier((, expression)
                                                         listener: handleIdentifier(x, expression)
                                                       listener: handleNoTypeArguments(-)
@@ -9810,11 +9619,11 @@
                         ensureSemicolon(1)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -9859,7 +9668,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -9872,7 +9681,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -9904,7 +9712,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -9915,7 +9723,6 @@
                               parsePrimary(return, expression, ConstantPatternContext.none)
                                 inPlainSync()
                                 parseSend(return, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(return)
                                   ensureIdentifier(return, expression)
                                     reportRecoverableErrorWithToken(var, Template(ExpectedIdentifier))
                                       listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got 'var'., Try inserting an identifier before 'var'., {lexeme: var}], var, var)
@@ -9931,7 +9738,7 @@
                           rewriter()
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, var)
+                  notEofOrType(CLOSE_CURLY_BRACKET, var)
                   parseStatement(;)
                     parseStatementX(;)
                       parseExpressionStatementOrDeclarationAfterModifiers(var, ;, null, var, null, null)
@@ -9956,7 +9763,7 @@
                               listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], (, ()
                             rewriter()
                           listener: endVariablesDeclaration(1, ;)
-                  notEofOrValue(}, x)
+                  notEofOrType(CLOSE_CURLY_BRACKET, x)
                   parseStatement(;)
                     parseStatementX(;)
                       parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -9968,7 +9775,6 @@
                                 parsePrimary(;, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                                     parseSend(;, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(;)
                                       ensureIdentifier(;, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments(-)
@@ -9987,7 +9793,7 @@
                               listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], 1, 1)
                             rewriter()
                           listener: handleExpressionStatement(x, ;)
-                  notEofOrValue(}, ))
+                  notEofOrType(CLOSE_CURLY_BRACKET, ))
                   parseStatement(;)
                     parseStatementX(;)
                       parseExpressionStatementOrDeclaration(;, null)
@@ -9999,7 +9805,6 @@
                                 parseUnaryExpression(;, true, ConstantPatternContext.none)
                                   parsePrimary(;, expression, ConstantPatternContext.none)
                                     parseSend(;, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(;)
                                       ensureIdentifier(;, expression)
                                         reportRecoverableErrorWithToken(), Template(ExpectedIdentifier))
                                           listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got ')'., Try inserting an identifier before ')'., {lexeme: )}], ), ))
@@ -10016,7 +9821,7 @@
                             listener: handleExpressionStatement(), ;)
                   reportRecoverableError(;, Message[UnexpectedToken, Unexpected token ';'., null, {lexeme: ;}])
                     listener: handleRecoverableError(Message[UnexpectedToken, Unexpected token ';'., null, {lexeme: ;}], ), ))
-                  notEofOrValue(}, +)
+                  notEofOrType(CLOSE_CURLY_BRACKET, +)
                   parseStatement())
                     parseStatementX())
                       parseExpressionStatementOrDeclaration(), null)
@@ -10033,7 +9838,6 @@
                                   parsePrimary(), expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(), expression, ConstantPatternContext.none)
                                       parseSend(), expression, ConstantPatternContext.none)
-                                        isNextIdentifier())
                                         ensureIdentifier(), expression)
                                           listener: handleIdentifier(, expression)
                                         listener: handleNoTypeArguments(+)
@@ -10049,11 +9853,11 @@
                                 listener: endBinaryExpression(+, 1)
                             ensureSemicolon(1)
                             listener: handleExpressionStatement(+, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(6, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -10098,7 +9902,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -10111,7 +9915,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -10143,7 +9946,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -10154,7 +9957,6 @@
                               parsePrimary(return, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       reportRecoverableErrorWithToken(void, Template(ExpectedIdentifier))
                                         listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got 'void'., Try inserting an identifier before 'void'., {lexeme: void}], void, void)
@@ -10170,7 +9972,7 @@
                           rewriter()
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, void)
+                  notEofOrType(CLOSE_CURLY_BRACKET, void)
                   parseStatement(;)
                     parseStatementX(;)
                       parseExpressionStatementOrDeclaration(;, null)
@@ -10196,7 +9998,7 @@
                                 listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], (, ()
                               rewriter()
                             listener: endVariablesDeclaration(1, ;)
-                  notEofOrValue(}, x)
+                  notEofOrType(CLOSE_CURLY_BRACKET, x)
                   parseStatement(;)
                     parseStatementX(;)
                       parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -10208,7 +10010,6 @@
                                 parsePrimary(;, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                                     parseSend(;, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(;)
                                       ensureIdentifier(;, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments(-)
@@ -10227,7 +10028,7 @@
                               listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], 1, 1)
                             rewriter()
                           listener: handleExpressionStatement(x, ;)
-                  notEofOrValue(}, ))
+                  notEofOrType(CLOSE_CURLY_BRACKET, ))
                   parseStatement(;)
                     parseStatementX(;)
                       parseExpressionStatementOrDeclaration(;, null)
@@ -10239,7 +10040,6 @@
                                 parseUnaryExpression(;, true, ConstantPatternContext.none)
                                   parsePrimary(;, expression, ConstantPatternContext.none)
                                     parseSend(;, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(;)
                                       ensureIdentifier(;, expression)
                                         reportRecoverableErrorWithToken(), Template(ExpectedIdentifier))
                                           listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got ')'., Try inserting an identifier before ')'., {lexeme: )}], ), ))
@@ -10256,7 +10056,7 @@
                             listener: handleExpressionStatement(), ;)
                   reportRecoverableError(;, Message[UnexpectedToken, Unexpected token ';'., null, {lexeme: ;}])
                     listener: handleRecoverableError(Message[UnexpectedToken, Unexpected token ';'., null, {lexeme: ;}], ), ))
-                  notEofOrValue(}, +)
+                  notEofOrType(CLOSE_CURLY_BRACKET, +)
                   parseStatement())
                     parseStatementX())
                       parseExpressionStatementOrDeclaration(), null)
@@ -10273,7 +10073,6 @@
                                   parsePrimary(), expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(), expression, ConstantPatternContext.none)
                                       parseSend(), expression, ConstantPatternContext.none)
-                                        isNextIdentifier())
                                         ensureIdentifier(), expression)
                                           listener: handleIdentifier(, expression)
                                         listener: handleNoTypeArguments(+)
@@ -10289,11 +10088,11 @@
                                 listener: endBinaryExpression(+, 1)
                             ensureSemicolon(1)
                             listener: handleExpressionStatement(+, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(6, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -10338,7 +10137,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -10351,7 +10150,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -10383,7 +10181,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -10394,7 +10192,6 @@
                               parsePrimary(return, expression, ConstantPatternContext.none)
                                 inPlainSync()
                                 parseSend(return, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(return)
                                   ensureIdentifier(return, expression)
                                     reportRecoverableErrorWithToken(while, Template(ExpectedIdentifier))
                                       listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got 'while'., Try inserting an identifier before 'while'., {lexeme: while}], while, while)
@@ -10410,7 +10207,7 @@
                           rewriter()
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, while)
+                  notEofOrType(CLOSE_CURLY_BRACKET, while)
                   parseStatement(;)
                     parseStatementX(;)
                       parseWhileStatement(;)
@@ -10423,7 +10220,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(-)
@@ -10456,7 +10252,6 @@
                                         parsePrimary(), expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral(), expression, ConstantPatternContext.none)
                                             parseSend(), expression, ConstantPatternContext.none)
-                                              isNextIdentifier())
                                               ensureIdentifier(), expression)
                                                 listener: handleIdentifier(, expression)
                                               listener: handleNoTypeArguments(+)
@@ -10474,11 +10269,11 @@
                                   listener: handleExpressionStatement(+, ;)
                         listener: endWhileStatementBody(;)
                         listener: endWhileStatement(while, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(3, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -10523,7 +10318,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -10536,7 +10331,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -10568,7 +10362,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -10579,7 +10373,6 @@
                               parsePrimary(return, expression, ConstantPatternContext.none)
                                 inPlainSync()
                                 parseSend(return, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(return)
                                   ensureIdentifier(return, expression)
                                     reportRecoverableErrorWithToken(with, Template(ExpectedIdentifierButGotKeyword))
                                       listener: handleRecoverableError(Message[ExpectedIdentifierButGotKeyword, 'with' can't be used as an identifier because it's a keyword., Try renaming this to be an identifier that isn't a keyword., {lexeme: with}], with, with)
@@ -10595,7 +10388,6 @@
                                               parsePrimary((, expression, ConstantPatternContext.none)
                                                 parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                   parseSend((, expression, ConstantPatternContext.none)
-                                                    isNextIdentifier(()
                                                     ensureIdentifier((, expression)
                                                       listener: handleIdentifier(x, expression)
                                                     listener: handleNoTypeArguments(-)
@@ -10621,11 +10413,11 @@
                         ensureSemicolon(1)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -10666,7 +10458,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -10679,7 +10471,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -10711,7 +10502,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -10724,7 +10515,6 @@
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody(+)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(yield, expression)
@@ -10739,7 +10529,6 @@
                                                 parsePrimary((, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                     parseSend((, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(()
                                                       ensureIdentifier((, expression)
                                                         listener: handleIdentifier(x, expression)
                                                       listener: handleNoTypeArguments(-)
@@ -10765,11 +10554,11 @@
                         ensureSemicolon(1)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 71, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/keyword_named_formal_parameter.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/keyword_named_formal_parameter.dart.intertwined.expect
index 6773f34..96d914a 100644
--- a/pkg/front_end/parser_testcases/error_recovery/keyword_named_formal_parameter.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/keyword_named_formal_parameter.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -82,7 +82,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -134,7 +134,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -178,7 +178,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -230,7 +230,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -282,7 +282,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -322,7 +322,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -366,7 +366,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -418,7 +418,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -462,7 +462,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -514,7 +514,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -566,7 +566,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -607,7 +607,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -652,7 +652,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -705,7 +705,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -750,7 +750,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -803,7 +803,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -856,7 +856,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -896,7 +896,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -940,7 +940,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -992,7 +992,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -1036,7 +1036,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -1088,7 +1088,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -1140,7 +1140,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -1180,7 +1180,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -1224,7 +1224,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -1276,7 +1276,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -1320,7 +1320,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -1372,7 +1372,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -1424,7 +1424,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -1465,7 +1465,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -1510,7 +1510,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -1563,7 +1563,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -1608,7 +1608,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -1661,7 +1661,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -1714,7 +1714,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -1755,7 +1755,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -1800,7 +1800,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -1853,7 +1853,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -1898,7 +1898,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -1951,7 +1951,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -2004,7 +2004,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -2045,7 +2045,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -2090,7 +2090,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -2143,7 +2143,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -2188,7 +2188,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -2241,7 +2241,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -2294,7 +2294,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -2335,7 +2335,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -2380,7 +2380,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -2433,7 +2433,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -2478,7 +2478,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -2531,7 +2531,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -2584,7 +2584,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -2625,7 +2625,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -2670,7 +2670,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -2723,7 +2723,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -2768,7 +2768,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -2821,7 +2821,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -2874,7 +2874,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -2915,7 +2915,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -2960,7 +2960,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -3013,7 +3013,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -3058,7 +3058,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -3111,7 +3111,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -3164,7 +3164,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -3204,7 +3204,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -3248,7 +3248,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -3300,7 +3300,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -3344,7 +3344,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -3396,7 +3396,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -3448,7 +3448,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -3489,7 +3489,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -3534,7 +3534,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -3587,7 +3587,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -3632,7 +3632,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -3685,7 +3685,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -3738,7 +3738,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -3778,7 +3778,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -3822,7 +3822,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -3874,7 +3874,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -3918,7 +3918,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -3970,7 +3970,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -4022,7 +4022,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -4063,7 +4063,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -4108,7 +4108,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -4161,7 +4161,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -4206,7 +4206,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -4259,7 +4259,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -4312,7 +4312,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -4352,7 +4352,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -4396,7 +4396,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -4448,7 +4448,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -4492,7 +4492,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -4544,7 +4544,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -4596,7 +4596,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -4637,7 +4637,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -4682,7 +4682,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -4735,7 +4735,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -4780,7 +4780,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -4833,7 +4833,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -4886,7 +4886,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -4927,7 +4927,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -4972,7 +4972,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -5025,7 +5025,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -5070,7 +5070,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -5123,7 +5123,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -5176,7 +5176,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -5216,7 +5216,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -5260,7 +5260,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -5312,7 +5312,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -5356,7 +5356,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -5408,7 +5408,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -5460,7 +5460,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -5501,7 +5501,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -5546,7 +5546,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -5599,7 +5599,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -5644,7 +5644,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -5697,7 +5697,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -5750,7 +5750,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -5790,7 +5790,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -5834,7 +5834,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -5886,7 +5886,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -5930,7 +5930,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -5982,7 +5982,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -6034,7 +6034,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -6074,7 +6074,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -6118,7 +6118,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -6170,7 +6170,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -6214,7 +6214,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -6266,7 +6266,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -6318,7 +6318,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -6358,7 +6358,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -6402,7 +6402,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -6454,7 +6454,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -6498,7 +6498,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -6550,7 +6550,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -6602,7 +6602,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -6643,7 +6643,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -6688,7 +6688,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -6741,7 +6741,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -6786,7 +6786,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -6839,7 +6839,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -6892,7 +6892,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -6933,7 +6933,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -6978,7 +6978,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -7031,7 +7031,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -7076,7 +7076,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -7129,7 +7129,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -7182,7 +7182,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -7223,7 +7223,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -7268,7 +7268,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -7321,7 +7321,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -7366,7 +7366,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -7419,7 +7419,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -7472,7 +7472,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -7513,7 +7513,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -7558,7 +7558,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -7611,7 +7611,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -7656,7 +7656,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -7709,7 +7709,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -7762,7 +7762,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -7802,7 +7802,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -7846,7 +7846,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -7898,7 +7898,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -7942,7 +7942,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -7994,7 +7994,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -8046,7 +8046,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -8086,7 +8086,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -8130,7 +8130,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -8182,7 +8182,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -8226,7 +8226,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -8278,7 +8278,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -8330,7 +8330,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -8370,7 +8370,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -8414,7 +8414,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -8466,7 +8466,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -8510,7 +8510,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -8562,7 +8562,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -8614,7 +8614,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -8655,7 +8655,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -8700,7 +8700,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -8753,7 +8753,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -8798,7 +8798,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -8851,7 +8851,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -8904,7 +8904,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -8944,7 +8944,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -8988,7 +8988,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -9040,7 +9040,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -9084,7 +9084,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -9136,7 +9136,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -9188,7 +9188,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -9228,7 +9228,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -9272,7 +9272,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -9324,7 +9324,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -9368,7 +9368,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -9420,7 +9420,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -9472,7 +9472,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -9513,7 +9513,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -9558,7 +9558,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -9611,7 +9611,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -9656,7 +9656,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -9709,7 +9709,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -9762,7 +9762,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -9802,7 +9802,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -9846,7 +9846,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -9898,7 +9898,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -9942,7 +9942,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -9994,7 +9994,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -10046,7 +10046,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -10086,7 +10086,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -10130,7 +10130,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -10182,7 +10182,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -10226,7 +10226,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -10278,7 +10278,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -10330,7 +10330,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -10371,7 +10371,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -10416,7 +10416,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -10469,7 +10469,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -10514,7 +10514,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -10567,7 +10567,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -10620,7 +10620,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -10660,7 +10660,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -10704,7 +10704,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -10756,7 +10756,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -10800,7 +10800,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -10852,7 +10852,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -10904,7 +10904,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -10944,7 +10944,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -10988,7 +10988,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -11040,7 +11040,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -11084,7 +11084,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -11136,7 +11136,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -11188,7 +11188,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -11228,7 +11228,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -11272,7 +11272,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -11324,7 +11324,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -11368,7 +11368,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -11420,7 +11420,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -11472,7 +11472,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -11512,7 +11512,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -11556,7 +11556,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -11608,7 +11608,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -11652,7 +11652,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -11704,7 +11704,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -11756,7 +11756,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -11797,7 +11797,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -11842,7 +11842,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -11895,7 +11895,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -11940,7 +11940,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -11993,7 +11993,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -12046,7 +12046,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -12087,7 +12087,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -12132,7 +12132,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -12185,7 +12185,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -12230,7 +12230,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -12283,7 +12283,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -12336,7 +12336,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -12376,7 +12376,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -12420,7 +12420,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -12472,7 +12472,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -12516,7 +12516,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -12568,7 +12568,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -12620,7 +12620,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -12660,7 +12660,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -12704,7 +12704,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -12756,7 +12756,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -12800,7 +12800,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -12852,7 +12852,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -12904,7 +12904,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -12944,7 +12944,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -12988,7 +12988,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -13040,7 +13040,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -13084,7 +13084,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -13136,7 +13136,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -13188,7 +13188,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -13228,7 +13228,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -13272,7 +13272,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -13324,7 +13324,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -13368,7 +13368,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -13420,7 +13420,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -13472,7 +13472,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -13512,7 +13512,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -13556,7 +13556,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -13608,7 +13608,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -13652,7 +13652,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -13704,7 +13704,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -13756,7 +13756,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -13796,7 +13796,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -13840,7 +13840,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -13892,7 +13892,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -13936,7 +13936,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -13988,7 +13988,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -14040,7 +14040,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -14080,7 +14080,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -14124,7 +14124,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -14176,7 +14176,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -14220,7 +14220,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -14272,7 +14272,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -14324,7 +14324,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -14365,7 +14365,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -14410,7 +14410,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -14463,7 +14463,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -14508,7 +14508,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -14561,7 +14561,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -14614,7 +14614,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -14655,7 +14655,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -14700,7 +14700,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -14753,7 +14753,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -14798,7 +14798,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -14851,7 +14851,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -14904,7 +14904,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -14944,7 +14944,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -14988,7 +14988,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -15040,7 +15040,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -15084,7 +15084,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -15136,7 +15136,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -15188,7 +15188,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -15228,7 +15228,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -15272,7 +15272,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -15324,7 +15324,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -15368,7 +15368,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -15420,7 +15420,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -15472,7 +15472,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -15512,7 +15512,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -15556,7 +15556,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -15608,7 +15608,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -15652,7 +15652,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -15704,7 +15704,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -15756,7 +15756,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -15796,7 +15796,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -15840,7 +15840,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -15892,7 +15892,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -15936,7 +15936,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -15988,7 +15988,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -16040,7 +16040,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -16081,7 +16081,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -16126,7 +16126,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -16179,7 +16179,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -16224,7 +16224,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -16277,7 +16277,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -16330,7 +16330,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -16371,7 +16371,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -16416,7 +16416,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -16469,7 +16469,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -16514,7 +16514,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -16567,7 +16567,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -16620,7 +16620,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -16660,7 +16660,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -16704,7 +16704,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -16756,7 +16756,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -16800,7 +16800,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -16852,7 +16852,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -16904,7 +16904,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -16945,7 +16945,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -16990,7 +16990,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -17043,7 +17043,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -17088,7 +17088,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -17141,7 +17141,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -17194,7 +17194,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -17235,7 +17235,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -17280,7 +17280,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -17333,7 +17333,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -17378,7 +17378,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -17431,7 +17431,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -17484,7 +17484,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -17525,7 +17525,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -17570,7 +17570,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -17623,7 +17623,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -17668,7 +17668,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -17721,7 +17721,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -17774,7 +17774,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -17815,7 +17815,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -17860,7 +17860,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -17913,7 +17913,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -17958,7 +17958,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -18011,7 +18011,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -18064,7 +18064,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -18104,7 +18104,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -18148,7 +18148,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -18200,7 +18200,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -18244,7 +18244,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -18296,7 +18296,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -18348,7 +18348,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -18389,7 +18389,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -18434,7 +18434,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -18487,7 +18487,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -18532,7 +18532,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -18585,7 +18585,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -18638,7 +18638,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -18679,7 +18679,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -18724,7 +18724,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -18777,7 +18777,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -18822,7 +18822,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -18875,7 +18875,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -18928,7 +18928,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -18969,7 +18969,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -19014,7 +19014,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -19067,7 +19067,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -19112,7 +19112,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -19165,7 +19165,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -19218,7 +19218,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -19259,7 +19259,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -19304,7 +19304,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -19357,7 +19357,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -19402,7 +19402,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -19455,7 +19455,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -19508,7 +19508,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -19548,7 +19548,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -19592,7 +19592,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -19644,7 +19644,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -19688,7 +19688,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -19740,7 +19740,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -19792,7 +19792,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/keyword_named_formal_parameter_prime.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/keyword_named_formal_parameter_prime.dart.intertwined.expect
index 096ae46..e163a6e 100644
--- a/pkg/front_end/parser_testcases/error_recovery/keyword_named_formal_parameter_prime.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/keyword_named_formal_parameter_prime.dart.intertwined.expect
@@ -37,7 +37,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -80,7 +80,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -131,7 +131,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -174,7 +174,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -225,7 +225,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -276,7 +276,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -315,7 +315,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -358,7 +358,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -409,7 +409,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -452,7 +452,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -503,7 +503,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -554,7 +554,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -593,7 +593,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -636,7 +636,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -687,7 +687,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -730,7 +730,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -781,7 +781,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -832,7 +832,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -871,7 +871,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -914,7 +914,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -965,7 +965,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -1008,7 +1008,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -1059,7 +1059,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -1110,7 +1110,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -1149,7 +1149,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -1192,7 +1192,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -1243,7 +1243,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -1286,7 +1286,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -1337,7 +1337,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -1388,7 +1388,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -1427,7 +1427,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -1470,7 +1470,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -1521,7 +1521,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -1564,7 +1564,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -1615,7 +1615,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -1666,7 +1666,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -1705,7 +1705,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -1748,7 +1748,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -1799,7 +1799,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -1842,7 +1842,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -1893,7 +1893,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -1944,7 +1944,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -1983,7 +1983,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -2026,7 +2026,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -2077,7 +2077,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -2120,7 +2120,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -2171,7 +2171,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -2222,7 +2222,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -2261,7 +2261,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -2304,7 +2304,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -2355,7 +2355,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -2398,7 +2398,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -2449,7 +2449,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -2500,7 +2500,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -2539,7 +2539,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -2582,7 +2582,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -2633,7 +2633,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -2676,7 +2676,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -2727,7 +2727,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -2778,7 +2778,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -2817,7 +2817,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -2860,7 +2860,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -2911,7 +2911,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -2954,7 +2954,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -3005,7 +3005,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -3056,7 +3056,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -3095,7 +3095,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -3138,7 +3138,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -3189,7 +3189,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -3232,7 +3232,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -3283,7 +3283,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -3334,7 +3334,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -3373,7 +3373,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -3416,7 +3416,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -3467,7 +3467,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -3510,7 +3510,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -3561,7 +3561,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -3612,7 +3612,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -3651,7 +3651,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -3694,7 +3694,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -3745,7 +3745,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -3788,7 +3788,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -3839,7 +3839,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -3890,7 +3890,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -3929,7 +3929,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -3972,7 +3972,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -4023,7 +4023,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -4066,7 +4066,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -4117,7 +4117,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -4168,7 +4168,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -4207,7 +4207,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -4250,7 +4250,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -4301,7 +4301,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -4344,7 +4344,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -4395,7 +4395,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -4446,7 +4446,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -4485,7 +4485,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -4528,7 +4528,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -4579,7 +4579,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -4622,7 +4622,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -4673,7 +4673,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -4724,7 +4724,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -4763,7 +4763,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -4806,7 +4806,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -4857,7 +4857,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -4900,7 +4900,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -4951,7 +4951,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -5002,7 +5002,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -5041,7 +5041,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -5084,7 +5084,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -5135,7 +5135,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -5178,7 +5178,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -5229,7 +5229,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -5280,7 +5280,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -5319,7 +5319,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -5362,7 +5362,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -5413,7 +5413,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -5456,7 +5456,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -5507,7 +5507,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -5558,7 +5558,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -5597,7 +5597,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -5640,7 +5640,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -5691,7 +5691,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -5734,7 +5734,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -5785,7 +5785,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -5836,7 +5836,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -5875,7 +5875,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -5918,7 +5918,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -5969,7 +5969,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -6012,7 +6012,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -6063,7 +6063,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -6114,7 +6114,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -6153,7 +6153,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -6196,7 +6196,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -6247,7 +6247,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -6290,7 +6290,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -6341,7 +6341,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -6392,7 +6392,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -6431,7 +6431,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -6474,7 +6474,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -6525,7 +6525,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -6568,7 +6568,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -6619,7 +6619,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -6670,7 +6670,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -6709,7 +6709,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -6752,7 +6752,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -6803,7 +6803,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -6846,7 +6846,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -6897,7 +6897,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -6948,7 +6948,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -6987,7 +6987,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -7030,7 +7030,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -7081,7 +7081,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -7124,7 +7124,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -7175,7 +7175,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -7226,7 +7226,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -7265,7 +7265,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -7308,7 +7308,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -7359,7 +7359,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -7402,7 +7402,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -7453,7 +7453,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -7504,7 +7504,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -7543,7 +7543,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -7586,7 +7586,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -7637,7 +7637,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -7680,7 +7680,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -7731,7 +7731,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -7782,7 +7782,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -7821,7 +7821,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -7864,7 +7864,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -7915,7 +7915,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -7958,7 +7958,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -8009,7 +8009,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -8060,7 +8060,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -8099,7 +8099,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -8142,7 +8142,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -8193,7 +8193,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -8236,7 +8236,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -8287,7 +8287,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -8338,7 +8338,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -8377,7 +8377,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -8420,7 +8420,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -8471,7 +8471,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -8514,7 +8514,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -8565,7 +8565,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -8616,7 +8616,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -8655,7 +8655,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -8698,7 +8698,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -8749,7 +8749,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -8792,7 +8792,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -8843,7 +8843,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -8894,7 +8894,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -8933,7 +8933,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -8976,7 +8976,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -9027,7 +9027,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -9070,7 +9070,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -9121,7 +9121,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -9172,7 +9172,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -9211,7 +9211,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -9254,7 +9254,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -9305,7 +9305,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -9348,7 +9348,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -9399,7 +9399,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -9450,7 +9450,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -9489,7 +9489,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -9532,7 +9532,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -9583,7 +9583,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -9626,7 +9626,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -9677,7 +9677,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -9728,7 +9728,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -9767,7 +9767,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -9810,7 +9810,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -9861,7 +9861,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -9904,7 +9904,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -9955,7 +9955,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -10006,7 +10006,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -10045,7 +10045,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -10088,7 +10088,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -10139,7 +10139,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -10182,7 +10182,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -10233,7 +10233,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -10284,7 +10284,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -10323,7 +10323,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -10366,7 +10366,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -10417,7 +10417,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -10460,7 +10460,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -10511,7 +10511,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -10562,7 +10562,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -10601,7 +10601,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -10644,7 +10644,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -10695,7 +10695,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -10738,7 +10738,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -10789,7 +10789,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -10840,7 +10840,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -10879,7 +10879,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -10922,7 +10922,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -10973,7 +10973,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -11016,7 +11016,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -11067,7 +11067,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -11118,7 +11118,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -11157,7 +11157,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -11200,7 +11200,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -11251,7 +11251,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -11294,7 +11294,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -11345,7 +11345,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -11396,7 +11396,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -11435,7 +11435,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -11478,7 +11478,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -11529,7 +11529,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -11572,7 +11572,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -11623,7 +11623,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -11674,7 +11674,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -11713,7 +11713,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -11756,7 +11756,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -11807,7 +11807,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -11850,7 +11850,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -11901,7 +11901,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -11952,7 +11952,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -11991,7 +11991,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -12034,7 +12034,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -12085,7 +12085,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -12128,7 +12128,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -12179,7 +12179,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -12230,7 +12230,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -12269,7 +12269,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -12312,7 +12312,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -12363,7 +12363,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -12406,7 +12406,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -12457,7 +12457,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -12508,7 +12508,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -12547,7 +12547,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -12590,7 +12590,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -12641,7 +12641,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -12684,7 +12684,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -12735,7 +12735,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -12786,7 +12786,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -12825,7 +12825,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -12868,7 +12868,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -12919,7 +12919,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -12962,7 +12962,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -13013,7 +13013,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -13064,7 +13064,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -13103,7 +13103,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -13146,7 +13146,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -13197,7 +13197,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -13240,7 +13240,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -13291,7 +13291,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -13342,7 +13342,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -13381,7 +13381,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -13424,7 +13424,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -13475,7 +13475,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -13518,7 +13518,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -13569,7 +13569,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -13620,7 +13620,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -13659,7 +13659,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -13702,7 +13702,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -13753,7 +13753,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -13796,7 +13796,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -13847,7 +13847,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -13898,7 +13898,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -13937,7 +13937,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -13980,7 +13980,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -14031,7 +14031,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -14074,7 +14074,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -14125,7 +14125,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -14176,7 +14176,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -14215,7 +14215,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -14258,7 +14258,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -14309,7 +14309,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -14352,7 +14352,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -14403,7 +14403,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -14454,7 +14454,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -14493,7 +14493,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -14536,7 +14536,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -14587,7 +14587,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -14630,7 +14630,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -14681,7 +14681,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -14732,7 +14732,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -14771,7 +14771,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -14814,7 +14814,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -14865,7 +14865,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -14908,7 +14908,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -14959,7 +14959,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -15010,7 +15010,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -15049,7 +15049,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -15092,7 +15092,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -15143,7 +15143,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -15186,7 +15186,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -15237,7 +15237,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -15288,7 +15288,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -15327,7 +15327,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -15370,7 +15370,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -15421,7 +15421,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -15464,7 +15464,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -15515,7 +15515,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -15566,7 +15566,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -15605,7 +15605,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -15648,7 +15648,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -15699,7 +15699,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -15742,7 +15742,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -15793,7 +15793,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -15844,7 +15844,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -15883,7 +15883,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -15926,7 +15926,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -15977,7 +15977,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -16020,7 +16020,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -16071,7 +16071,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -16122,7 +16122,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -16161,7 +16161,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -16204,7 +16204,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -16255,7 +16255,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -16298,7 +16298,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -16349,7 +16349,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -16400,7 +16400,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -16439,7 +16439,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -16482,7 +16482,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -16533,7 +16533,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -16576,7 +16576,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -16627,7 +16627,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -16678,7 +16678,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -16717,7 +16717,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -16760,7 +16760,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -16811,7 +16811,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -16854,7 +16854,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -16905,7 +16905,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -16956,7 +16956,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -16995,7 +16995,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -17038,7 +17038,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -17089,7 +17089,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -17132,7 +17132,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -17183,7 +17183,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -17234,7 +17234,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -17273,7 +17273,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -17316,7 +17316,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -17367,7 +17367,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -17410,7 +17410,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -17461,7 +17461,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -17512,7 +17512,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -17551,7 +17551,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -17594,7 +17594,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -17645,7 +17645,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -17688,7 +17688,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -17739,7 +17739,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -17790,7 +17790,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -17829,7 +17829,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -17872,7 +17872,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -17923,7 +17923,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -17966,7 +17966,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -18017,7 +18017,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -18068,7 +18068,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -18107,7 +18107,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -18150,7 +18150,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -18201,7 +18201,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -18244,7 +18244,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -18295,7 +18295,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -18346,7 +18346,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -18385,7 +18385,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -18428,7 +18428,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -18479,7 +18479,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -18522,7 +18522,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -18573,7 +18573,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -18624,7 +18624,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -18663,7 +18663,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -18706,7 +18706,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -18757,7 +18757,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -18800,7 +18800,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -18851,7 +18851,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -18902,7 +18902,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -18941,7 +18941,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -18984,7 +18984,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -19035,7 +19035,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -19078,7 +19078,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -19129,7 +19129,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -19180,7 +19180,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/keyword_named_formal_parameter_start_of_next_top_level.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/keyword_named_formal_parameter_start_of_next_top_level.dart.intertwined.expect
index 57504bb..330c21e 100644
--- a/pkg/front_end/parser_testcases/error_recovery/keyword_named_formal_parameter_start_of_next_top_level.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/keyword_named_formal_parameter_start_of_next_top_level.dart.intertwined.expect
@@ -68,7 +68,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(C, DeclarationKind.Class, C)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/keyword_named_top_level_methods.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/keyword_named_top_level_methods.dart.intertwined.expect
index a3b89f3..47e4b4b 100644
--- a/pkg/front_end/parser_testcases/error_recovery/keyword_named_top_level_methods.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/keyword_named_top_level_methods.dart.intertwined.expect
@@ -39,7 +39,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -52,7 +52,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -84,7 +83,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -97,7 +96,6 @@
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           looksLikeFunctionBody(+)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               inPlainSync()
                               listener: handleIdentifier(abstract, expression)
@@ -112,7 +110,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(x, expression)
                                               listener: handleNoTypeArguments(-)
@@ -138,7 +135,7 @@
                 ensureSemicolon(1)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -179,7 +176,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -192,7 +189,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -224,7 +220,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -237,7 +233,6 @@
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           looksLikeFunctionBody(+)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               inPlainSync()
                               listener: handleIdentifier(as, expression)
@@ -252,7 +247,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(x, expression)
                                               listener: handleNoTypeArguments(-)
@@ -278,7 +272,7 @@
                 ensureSemicolon(1)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -323,7 +317,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -336,7 +330,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -368,7 +361,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -386,7 +379,6 @@
                                 parsePrimary((, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                     parseSend((, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(()
                                       ensureIdentifier((, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments(-)
@@ -413,7 +405,7 @@
                 ensureSemicolon(1)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -454,7 +446,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -467,7 +459,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -499,7 +490,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -512,7 +503,6 @@
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           looksLikeFunctionBody(+)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               inPlainSync()
                               listener: handleIdentifier(async, expression)
@@ -527,7 +517,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(x, expression)
                                               listener: handleNoTypeArguments(-)
@@ -553,7 +542,7 @@
                 ensureSemicolon(1)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -594,7 +583,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -607,7 +596,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -639,7 +627,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -655,7 +643,6 @@
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           looksLikeFunctionBody(+)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               inPlainSync()
                               listener: handleIdentifier(await, expression)
@@ -670,7 +657,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(x, expression)
                                               listener: handleNoTypeArguments(-)
@@ -696,7 +682,7 @@
                 ensureSemicolon(1)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -741,7 +727,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -754,7 +740,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -786,7 +771,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -797,7 +782,6 @@
                       parsePrimary(return, expression, ConstantPatternContext.none)
                         inPlainSync()
                         parseSend(return, expression, ConstantPatternContext.none)
-                          isNextIdentifier(return)
                           ensureIdentifier(return, expression)
                             reportRecoverableErrorWithToken(break, Template(ExpectedIdentifier))
                               listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got 'break'., Try inserting an identifier before 'break'., {lexeme: break}], break, break)
@@ -813,7 +797,7 @@
                   rewriter()
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, break)
+          notEofOrType(CLOSE_CURLY_BRACKET, break)
           parseStatement(;)
             parseStatementX(;)
               parseBreakStatement(;)
@@ -825,7 +809,7 @@
                     listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], break, break)
                   rewriter()
                 listener: handleBreakStatement(false, break, ;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -845,7 +829,6 @@
                                       parsePrimary((, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                           parseSend((, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(()
                                             ensureIdentifier((, expression)
                                               listener: handleIdentifier(x, expression)
                                             listener: handleNoTypeArguments(-)
@@ -870,7 +853,7 @@
                         listener: endBinaryExpression(+, 1)
                     ensureSemicolon(1)
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(4, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -915,7 +898,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -928,7 +911,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -960,7 +942,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -971,7 +953,6 @@
                       parsePrimary(return, expression, ConstantPatternContext.none)
                         inPlainSync()
                         parseSend(return, expression, ConstantPatternContext.none)
-                          isNextIdentifier(return)
                           ensureIdentifier(return, expression)
                             reportRecoverableErrorWithToken(case, Template(ExpectedIdentifierButGotKeyword))
                               listener: handleRecoverableError(Message[ExpectedIdentifierButGotKeyword, 'case' can't be used as an identifier because it's a keyword., Try renaming this to be an identifier that isn't a keyword., {lexeme: case}], case, case)
@@ -987,7 +968,6 @@
                                       parsePrimary((, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                           parseSend((, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(()
                                             ensureIdentifier((, expression)
                                               listener: handleIdentifier(x, expression)
                                             listener: handleNoTypeArguments(-)
@@ -1013,7 +993,7 @@
                 ensureSemicolon(1)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -1058,7 +1038,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -1071,7 +1051,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -1103,7 +1082,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -1114,7 +1093,6 @@
                       parsePrimary(return, expression, ConstantPatternContext.none)
                         inPlainSync()
                         parseSend(return, expression, ConstantPatternContext.none)
-                          isNextIdentifier(return)
                           ensureIdentifier(return, expression)
                             reportRecoverableErrorWithToken(catch, Template(ExpectedIdentifierButGotKeyword))
                               listener: handleRecoverableError(Message[ExpectedIdentifierButGotKeyword, 'catch' can't be used as an identifier because it's a keyword., Try renaming this to be an identifier that isn't a keyword., {lexeme: catch}], catch, catch)
@@ -1130,7 +1108,6 @@
                                       parsePrimary((, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                           parseSend((, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(()
                                             ensureIdentifier((, expression)
                                               listener: handleIdentifier(x, expression)
                                             listener: handleNoTypeArguments(-)
@@ -1156,7 +1133,7 @@
                 ensureSemicolon(1)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -1201,7 +1178,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -1214,7 +1191,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -1246,7 +1222,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -1257,7 +1233,6 @@
                       parsePrimary(return, expression, ConstantPatternContext.none)
                         inPlainSync()
                         parseSend(return, expression, ConstantPatternContext.none)
-                          isNextIdentifier(return)
                           ensureIdentifier(return, expression)
                             reportRecoverableErrorWithToken(class, Template(ExpectedIdentifierButGotKeyword))
                               listener: handleRecoverableError(Message[ExpectedIdentifierButGotKeyword, 'class' can't be used as an identifier because it's a keyword., Try renaming this to be an identifier that isn't a keyword., {lexeme: class}], class, class)
@@ -1273,7 +1248,6 @@
                                       parsePrimary((, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                           parseSend((, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(()
                                             ensureIdentifier((, expression)
                                               listener: handleIdentifier(x, expression)
                                             listener: handleNoTypeArguments(-)
@@ -1299,7 +1273,7 @@
                 ensureSemicolon(1)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -1344,7 +1318,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -1357,7 +1331,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -1389,7 +1362,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -1408,7 +1381,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(-)
@@ -1437,7 +1409,7 @@
                 ensureSemicolon(1)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -1482,7 +1454,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -1495,7 +1467,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -1527,7 +1498,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -1538,7 +1509,6 @@
                       parsePrimary(return, expression, ConstantPatternContext.none)
                         inPlainSync()
                         parseSend(return, expression, ConstantPatternContext.none)
-                          isNextIdentifier(return)
                           ensureIdentifier(return, expression)
                             reportRecoverableErrorWithToken(continue, Template(ExpectedIdentifier))
                               listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got 'continue'., Try inserting an identifier before 'continue'., {lexeme: continue}], continue, continue)
@@ -1554,7 +1524,7 @@
                   rewriter()
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, continue)
+          notEofOrType(CLOSE_CURLY_BRACKET, continue)
           parseStatement(;)
             parseStatementX(;)
               parseContinueStatement(;)
@@ -1566,7 +1536,7 @@
                     listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], continue, continue)
                   rewriter()
                 listener: handleContinueStatement(false, continue, ;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1586,7 +1556,6 @@
                                       parsePrimary((, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                           parseSend((, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(()
                                             ensureIdentifier((, expression)
                                               listener: handleIdentifier(x, expression)
                                             listener: handleNoTypeArguments(-)
@@ -1611,7 +1580,7 @@
                         listener: endBinaryExpression(+, 1)
                     ensureSemicolon(1)
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(4, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -1652,7 +1621,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -1665,7 +1634,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -1697,7 +1665,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -1710,7 +1678,6 @@
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           looksLikeFunctionBody(+)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               inPlainSync()
                               listener: handleIdentifier(covariant, expression)
@@ -1725,7 +1692,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(x, expression)
                                               listener: handleNoTypeArguments(-)
@@ -1751,7 +1717,7 @@
                 ensureSemicolon(1)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -1796,7 +1762,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -1809,7 +1775,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -1841,7 +1806,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -1852,7 +1817,6 @@
                       parsePrimary(return, expression, ConstantPatternContext.none)
                         inPlainSync()
                         parseSend(return, expression, ConstantPatternContext.none)
-                          isNextIdentifier(return)
                           ensureIdentifier(return, expression)
                             reportRecoverableErrorWithToken(default, Template(ExpectedIdentifierButGotKeyword))
                               listener: handleRecoverableError(Message[ExpectedIdentifierButGotKeyword, 'default' can't be used as an identifier because it's a keyword., Try renaming this to be an identifier that isn't a keyword., {lexeme: default}], default, default)
@@ -1868,7 +1832,6 @@
                                       parsePrimary((, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                           parseSend((, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(()
                                             ensureIdentifier((, expression)
                                               listener: handleIdentifier(x, expression)
                                             listener: handleNoTypeArguments(-)
@@ -1894,7 +1857,7 @@
                 ensureSemicolon(1)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -1935,7 +1898,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -1948,7 +1911,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -1980,7 +1942,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -1993,7 +1955,6 @@
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           looksLikeFunctionBody(+)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               inPlainSync()
                               listener: handleIdentifier(deferred, expression)
@@ -2008,7 +1969,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(x, expression)
                                               listener: handleNoTypeArguments(-)
@@ -2034,7 +1994,7 @@
                 ensureSemicolon(1)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -2079,7 +2039,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -2092,7 +2052,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -2124,7 +2083,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -2135,7 +2094,6 @@
                       parsePrimary(return, expression, ConstantPatternContext.none)
                         inPlainSync()
                         parseSend(return, expression, ConstantPatternContext.none)
-                          isNextIdentifier(return)
                           ensureIdentifier(return, expression)
                             reportRecoverableErrorWithToken(do, Template(ExpectedIdentifier))
                               listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got 'do'., Try inserting an identifier before 'do'., {lexeme: do}], do, do)
@@ -2151,7 +2109,7 @@
                   rewriter()
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, do)
+          notEofOrType(CLOSE_CURLY_BRACKET, do)
           parseStatement(;)
             parseStatementX(;)
               parseDoWhileStatement(;)
@@ -2176,7 +2134,6 @@
                                             parsePrimary((, expression, ConstantPatternContext.none)
                                               parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                 parseSend((, expression, ConstantPatternContext.none)
-                                                  isNextIdentifier(()
                                                   ensureIdentifier((, expression)
                                                     listener: handleIdentifier(x, expression)
                                                   listener: handleNoTypeArguments(-)
@@ -2215,7 +2172,6 @@
                         parseUnaryExpression((, true, ConstantPatternContext.none)
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSend((, expression, ConstantPatternContext.none)
-                              isNextIdentifier(()
                               ensureIdentifier((, expression)
                                 reportRecoverableErrorWithToken(), Template(ExpectedIdentifier))
                                   listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got '}'., Try inserting an identifier before '}'., {lexeme: }}], }, })
@@ -2232,7 +2188,7 @@
                     listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], ;, ;)
                   rewriter()
                 listener: endDoWhileStatement(do, while, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(3, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -2273,7 +2229,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -2286,7 +2242,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -2318,7 +2273,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -2331,7 +2286,6 @@
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           looksLikeFunctionBody(+)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               inPlainSync()
                               listener: handleIdentifier(dynamic, expression)
@@ -2346,7 +2300,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(x, expression)
                                               listener: handleNoTypeArguments(-)
@@ -2372,7 +2325,7 @@
                 ensureSemicolon(1)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -2417,7 +2370,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -2430,7 +2383,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -2462,7 +2414,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -2473,7 +2425,6 @@
                       parsePrimary(return, expression, ConstantPatternContext.none)
                         inPlainSync()
                         parseSend(return, expression, ConstantPatternContext.none)
-                          isNextIdentifier(return)
                           ensureIdentifier(return, expression)
                             reportRecoverableErrorWithToken(else, Template(ExpectedIdentifier))
                               listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got 'else'., Try inserting an identifier before 'else'., {lexeme: else}], else, else)
@@ -2489,7 +2440,7 @@
                   rewriter()
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, else)
+          notEofOrType(CLOSE_CURLY_BRACKET, else)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -2502,7 +2453,6 @@
                           parsePrimary(;, expression, ConstantPatternContext.none)
                             inPlainSync()
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 reportRecoverableErrorWithToken(else, Template(ExpectedIdentifier))
                                   listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got 'else'., Try inserting an identifier before 'else'., {lexeme: else}], else, else)
@@ -2519,7 +2469,7 @@
                     listener: handleExpressionStatement(else, ;)
           reportRecoverableError(;, Message[UnexpectedToken, Unexpected token ';'., null, {lexeme: ;}])
             listener: handleRecoverableError(Message[UnexpectedToken, Unexpected token ';'., null, {lexeme: ;}], else, else)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(else)
             parseStatementX(else)
               parseExpressionStatementOrDeclaration(else, null)
@@ -2539,7 +2489,6 @@
                                       parsePrimary((, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                           parseSend((, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(()
                                             ensureIdentifier((, expression)
                                               listener: handleIdentifier(x, expression)
                                             listener: handleNoTypeArguments(-)
@@ -2564,7 +2513,7 @@
                         listener: endBinaryExpression(+, 1)
                     ensureSemicolon(1)
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(4, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -2609,7 +2558,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -2622,7 +2571,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -2654,7 +2602,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -2665,7 +2613,6 @@
                       parsePrimary(return, expression, ConstantPatternContext.none)
                         inPlainSync()
                         parseSend(return, expression, ConstantPatternContext.none)
-                          isNextIdentifier(return)
                           ensureIdentifier(return, expression)
                             reportRecoverableErrorWithToken(enum, Template(ExpectedIdentifierButGotKeyword))
                               listener: handleRecoverableError(Message[ExpectedIdentifierButGotKeyword, 'enum' can't be used as an identifier because it's a keyword., Try renaming this to be an identifier that isn't a keyword., {lexeme: enum}], enum, enum)
@@ -2681,7 +2628,6 @@
                                       parsePrimary((, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                           parseSend((, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(()
                                             ensureIdentifier((, expression)
                                               listener: handleIdentifier(x, expression)
                                             listener: handleNoTypeArguments(-)
@@ -2707,7 +2653,7 @@
                 ensureSemicolon(1)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -2748,7 +2694,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -2761,7 +2707,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -2793,7 +2738,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -2806,7 +2751,6 @@
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           looksLikeFunctionBody(+)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               inPlainSync()
                               listener: handleIdentifier(export, expression)
@@ -2821,7 +2765,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(x, expression)
                                               listener: handleNoTypeArguments(-)
@@ -2847,7 +2790,7 @@
                 ensureSemicolon(1)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -2892,7 +2835,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -2905,7 +2848,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -2937,7 +2879,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -2948,7 +2890,6 @@
                       parsePrimary(return, expression, ConstantPatternContext.none)
                         inPlainSync()
                         parseSend(return, expression, ConstantPatternContext.none)
-                          isNextIdentifier(return)
                           ensureIdentifier(return, expression)
                             reportRecoverableErrorWithToken(extends, Template(ExpectedIdentifierButGotKeyword))
                               listener: handleRecoverableError(Message[ExpectedIdentifierButGotKeyword, 'extends' can't be used as an identifier because it's a keyword., Try renaming this to be an identifier that isn't a keyword., {lexeme: extends}], extends, extends)
@@ -2964,7 +2905,6 @@
                                       parsePrimary((, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                           parseSend((, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(()
                                             ensureIdentifier((, expression)
                                               listener: handleIdentifier(x, expression)
                                             listener: handleNoTypeArguments(-)
@@ -2990,7 +2930,7 @@
                 ensureSemicolon(1)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -3031,7 +2971,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -3044,7 +2984,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -3076,7 +3015,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -3089,7 +3028,6 @@
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           looksLikeFunctionBody(+)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               inPlainSync()
                               listener: handleIdentifier(extension, expression)
@@ -3104,7 +3042,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(x, expression)
                                               listener: handleNoTypeArguments(-)
@@ -3130,7 +3067,7 @@
                 ensureSemicolon(1)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -3171,7 +3108,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -3184,7 +3121,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -3216,7 +3152,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -3229,7 +3165,6 @@
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           looksLikeFunctionBody(+)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               inPlainSync()
                               listener: handleIdentifier(external, expression)
@@ -3244,7 +3179,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(x, expression)
                                               listener: handleNoTypeArguments(-)
@@ -3270,7 +3204,7 @@
                 ensureSemicolon(1)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -3311,7 +3245,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -3324,7 +3258,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -3356,7 +3289,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -3369,7 +3302,6 @@
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           looksLikeFunctionBody(+)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               inPlainSync()
                               listener: handleIdentifier(factory, expression)
@@ -3384,7 +3316,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(x, expression)
                                               listener: handleNoTypeArguments(-)
@@ -3410,7 +3341,7 @@
                 ensureSemicolon(1)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -3455,7 +3386,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -3468,7 +3399,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -3500,7 +3430,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -3522,7 +3452,6 @@
                                 parsePrimary((, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                     parseSend((, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(()
                                       ensureIdentifier((, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments(-)
@@ -3548,7 +3477,7 @@
                 ensureSemicolon(1)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -3593,7 +3522,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -3606,7 +3535,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -3638,7 +3566,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -3649,7 +3577,6 @@
                       parsePrimary(return, expression, ConstantPatternContext.none)
                         inPlainSync()
                         parseSend(return, expression, ConstantPatternContext.none)
-                          isNextIdentifier(return)
                           ensureIdentifier(return, expression)
                             reportRecoverableErrorWithToken(final, Template(ExpectedIdentifier))
                               listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got 'final'., Try inserting an identifier before 'final'., {lexeme: final}], final, final)
@@ -3665,7 +3592,7 @@
                   rewriter()
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, final)
+          notEofOrType(CLOSE_CURLY_BRACKET, final)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(final, ;, null, final, null, null)
@@ -3690,7 +3617,7 @@
                       listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], (, ()
                     rewriter()
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, x)
+          notEofOrType(CLOSE_CURLY_BRACKET, x)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -3702,7 +3629,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(x, expression)
                               listener: handleNoTypeArguments(-)
@@ -3721,7 +3647,7 @@
                       listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], 1, 1)
                     rewriter()
                   listener: handleExpressionStatement(x, ;)
-          notEofOrValue(}, ))
+          notEofOrType(CLOSE_CURLY_BRACKET, ))
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -3733,7 +3659,6 @@
                         parseUnaryExpression(;, true, ConstantPatternContext.none)
                           parsePrimary(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 reportRecoverableErrorWithToken(), Template(ExpectedIdentifier))
                                   listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got ')'., Try inserting an identifier before ')'., {lexeme: )}], ), ))
@@ -3750,7 +3675,7 @@
                     listener: handleExpressionStatement(), ;)
           reportRecoverableError(;, Message[UnexpectedToken, Unexpected token ';'., null, {lexeme: ;}])
             listener: handleRecoverableError(Message[UnexpectedToken, Unexpected token ';'., null, {lexeme: ;}], ), ))
-          notEofOrValue(}, +)
+          notEofOrType(CLOSE_CURLY_BRACKET, +)
           parseStatement())
             parseStatementX())
               parseExpressionStatementOrDeclaration(), null)
@@ -3767,7 +3692,6 @@
                           parsePrimary(), expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(), expression, ConstantPatternContext.none)
                               parseSend(), expression, ConstantPatternContext.none)
-                                isNextIdentifier())
                                 ensureIdentifier(), expression)
                                   listener: handleIdentifier(, expression)
                                 listener: handleNoTypeArguments(+)
@@ -3783,7 +3707,7 @@
                         listener: endBinaryExpression(+, 1)
                     ensureSemicolon(1)
                     listener: handleExpressionStatement(+, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(6, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -3828,7 +3752,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -3841,7 +3765,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -3873,7 +3796,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -3884,7 +3807,6 @@
                       parsePrimary(return, expression, ConstantPatternContext.none)
                         inPlainSync()
                         parseSend(return, expression, ConstantPatternContext.none)
-                          isNextIdentifier(return)
                           ensureIdentifier(return, expression)
                             reportRecoverableErrorWithToken(finally, Template(ExpectedIdentifierButGotKeyword))
                               listener: handleRecoverableError(Message[ExpectedIdentifierButGotKeyword, 'finally' can't be used as an identifier because it's a keyword., Try renaming this to be an identifier that isn't a keyword., {lexeme: finally}], finally, finally)
@@ -3900,7 +3822,6 @@
                                       parsePrimary((, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                           parseSend((, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(()
                                             ensureIdentifier((, expression)
                                               listener: handleIdentifier(x, expression)
                                             listener: handleNoTypeArguments(-)
@@ -3926,7 +3847,7 @@
                 ensureSemicolon(1)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -3971,7 +3892,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -3984,7 +3905,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -4016,7 +3936,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -4027,7 +3947,6 @@
                       parsePrimary(return, expression, ConstantPatternContext.none)
                         inPlainSync()
                         parseSend(return, expression, ConstantPatternContext.none)
-                          isNextIdentifier(return)
                           ensureIdentifier(return, expression)
                             reportRecoverableErrorWithToken(for, Template(ExpectedIdentifier))
                               listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got 'for'., Try inserting an identifier before 'for'., {lexeme: for}], for, for)
@@ -4043,7 +3962,7 @@
                   rewriter()
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, for)
+          notEofOrType(CLOSE_CURLY_BRACKET, for)
           parseStatement(;)
             parseStatementX(;)
               parseForStatement(;, null)
@@ -4058,7 +3977,6 @@
                         parsePrimary((, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                             parseSend((, expression, ConstantPatternContext.none)
-                              isNextIdentifier(()
                               ensureIdentifier((, expression)
                                 listener: handleIdentifier(x, expression)
                               listener: handleNoTypeArguments(-)
@@ -4085,7 +4003,6 @@
                           parseUnaryExpression(;, true, ConstantPatternContext.none)
                             parsePrimary(;, expression, ConstantPatternContext.none)
                               parseSend(;, expression, ConstantPatternContext.none)
-                                isNextIdentifier(;)
                                 ensureIdentifier(;, expression)
                                   reportRecoverableErrorWithToken(), Template(ExpectedIdentifier))
                                     listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got ')'., Try inserting an identifier before ')'., {lexeme: )}], ), ))
@@ -4118,7 +4035,6 @@
                                   parsePrimary(), expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(), expression, ConstantPatternContext.none)
                                       parseSend(), expression, ConstantPatternContext.none)
-                                        isNextIdentifier())
                                         ensureIdentifier(), expression)
                                           listener: handleIdentifier(, expression)
                                         listener: handleNoTypeArguments(+)
@@ -4136,7 +4052,7 @@
                             listener: handleExpressionStatement(+, ;)
                   listener: endForStatementBody(;)
                   listener: endForStatement(;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(3, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -4177,7 +4093,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -4190,7 +4106,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -4222,7 +4137,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -4235,7 +4150,6 @@
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           looksLikeFunctionBody(+)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               inPlainSync()
                               listener: handleIdentifier(Function, expression)
@@ -4250,7 +4164,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(x, expression)
                                               listener: handleNoTypeArguments(-)
@@ -4276,7 +4189,7 @@
                 ensureSemicolon(1)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -4317,7 +4230,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -4330,7 +4243,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -4362,7 +4274,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -4375,7 +4287,6 @@
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           looksLikeFunctionBody(+)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               inPlainSync()
                               listener: handleIdentifier(get, expression)
@@ -4390,7 +4301,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(x, expression)
                                               listener: handleNoTypeArguments(-)
@@ -4416,7 +4326,7 @@
                 ensureSemicolon(1)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -4457,7 +4367,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -4470,7 +4380,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -4502,7 +4411,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -4515,7 +4424,6 @@
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           looksLikeFunctionBody(+)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               inPlainSync()
                               listener: handleIdentifier(hide, expression)
@@ -4530,7 +4438,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(x, expression)
                                               listener: handleNoTypeArguments(-)
@@ -4556,7 +4463,7 @@
                 ensureSemicolon(1)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -4601,7 +4508,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -4614,7 +4521,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -4646,7 +4552,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -4657,7 +4563,6 @@
                       parsePrimary(return, expression, ConstantPatternContext.none)
                         inPlainSync()
                         parseSend(return, expression, ConstantPatternContext.none)
-                          isNextIdentifier(return)
                           ensureIdentifier(return, expression)
                             reportRecoverableErrorWithToken(if, Template(ExpectedIdentifier))
                               listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got 'if'., Try inserting an identifier before 'if'., {lexeme: if}], if, if)
@@ -4673,7 +4578,7 @@
                   rewriter()
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement(;)
             parseStatementX(;)
               parseIfStatement(;)
@@ -4686,7 +4591,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(-)
@@ -4719,7 +4623,6 @@
                                 parsePrimary(), expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(), expression, ConstantPatternContext.none)
                                     parseSend(), expression, ConstantPatternContext.none)
-                                      isNextIdentifier())
                                       ensureIdentifier(), expression)
                                         listener: handleIdentifier(, expression)
                                       listener: handleNoTypeArguments(+)
@@ -4737,7 +4640,7 @@
                           listener: handleExpressionStatement(+, ;)
                 listener: endThenStatement(+, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(3, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -4778,7 +4681,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -4791,7 +4694,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -4823,7 +4725,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -4836,7 +4738,6 @@
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           looksLikeFunctionBody(+)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               inPlainSync()
                               listener: handleIdentifier(implements, expression)
@@ -4851,7 +4752,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(x, expression)
                                               listener: handleNoTypeArguments(-)
@@ -4877,7 +4777,7 @@
                 ensureSemicolon(1)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -4918,7 +4818,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -4931,7 +4831,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -4963,7 +4862,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -4976,7 +4875,6 @@
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           looksLikeFunctionBody(+)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               inPlainSync()
                               listener: handleIdentifier(import, expression)
@@ -4991,7 +4889,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(x, expression)
                                               listener: handleNoTypeArguments(-)
@@ -5017,7 +4914,7 @@
                 ensureSemicolon(1)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -5062,7 +4959,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -5075,7 +4972,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -5107,7 +5003,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -5118,7 +5014,6 @@
                       parsePrimary(return, expression, ConstantPatternContext.none)
                         inPlainSync()
                         parseSend(return, expression, ConstantPatternContext.none)
-                          isNextIdentifier(return)
                           ensureIdentifier(return, expression)
                             reportRecoverableErrorWithToken(in, Template(ExpectedIdentifierButGotKeyword))
                               listener: handleRecoverableError(Message[ExpectedIdentifierButGotKeyword, 'in' can't be used as an identifier because it's a keyword., Try renaming this to be an identifier that isn't a keyword., {lexeme: in}], in, in)
@@ -5134,7 +5029,6 @@
                                       parsePrimary((, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                           parseSend((, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(()
                                             ensureIdentifier((, expression)
                                               listener: handleIdentifier(x, expression)
                                             listener: handleNoTypeArguments(-)
@@ -5160,7 +5054,7 @@
                 ensureSemicolon(1)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -5201,7 +5095,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -5214,7 +5108,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -5246,7 +5139,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -5259,7 +5152,6 @@
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           looksLikeFunctionBody(+)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               inPlainSync()
                               listener: handleIdentifier(inout, expression)
@@ -5274,7 +5166,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(x, expression)
                                               listener: handleNoTypeArguments(-)
@@ -5300,7 +5191,7 @@
                 ensureSemicolon(1)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -5341,7 +5232,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -5354,7 +5245,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -5386,7 +5276,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -5399,7 +5289,6 @@
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           looksLikeFunctionBody(+)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               inPlainSync()
                               listener: handleIdentifier(interface, expression)
@@ -5414,7 +5303,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(x, expression)
                                               listener: handleNoTypeArguments(-)
@@ -5440,7 +5328,7 @@
                 ensureSemicolon(1)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -5485,7 +5373,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -5498,7 +5386,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -5530,7 +5417,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -5541,7 +5428,6 @@
                       parsePrimary(return, expression, ConstantPatternContext.none)
                         inPlainSync()
                         parseSend(return, expression, ConstantPatternContext.none)
-                          isNextIdentifier(return)
                           ensureIdentifier(return, expression)
                             reportRecoverableErrorWithToken(is, Template(ExpectedIdentifier))
                               listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got 'is'., Try inserting an identifier before 'is'., {lexeme: is}], is, is)
@@ -5581,7 +5467,7 @@
                   rewriter()
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, +)
+          notEofOrType(CLOSE_CURLY_BRACKET, +)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -5598,7 +5484,6 @@
                           parsePrimary(;, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                               parseSend(;, expression, ConstantPatternContext.none)
-                                isNextIdentifier(;)
                                 ensureIdentifier(;, expression)
                                   listener: handleIdentifier(, expression)
                                 listener: handleNoTypeArguments(+)
@@ -5614,7 +5499,7 @@
                         listener: endBinaryExpression(+, 1)
                     ensureSemicolon(1)
                     listener: handleExpressionStatement(+, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(3, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -5655,7 +5540,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -5668,7 +5553,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -5700,7 +5584,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -5713,7 +5597,6 @@
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           looksLikeFunctionBody(+)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               inPlainSync()
                               listener: handleIdentifier(late, expression)
@@ -5728,7 +5611,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(x, expression)
                                               listener: handleNoTypeArguments(-)
@@ -5754,7 +5636,7 @@
                 ensureSemicolon(1)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -5795,7 +5677,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -5808,7 +5690,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -5840,7 +5721,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -5853,7 +5734,6 @@
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           looksLikeFunctionBody(+)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               inPlainSync()
                               listener: handleIdentifier(library, expression)
@@ -5868,7 +5748,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(x, expression)
                                               listener: handleNoTypeArguments(-)
@@ -5894,7 +5773,7 @@
                 ensureSemicolon(1)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -5935,7 +5814,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -5948,7 +5827,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -5980,7 +5858,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -5993,7 +5871,6 @@
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           looksLikeFunctionBody(+)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               inPlainSync()
                               listener: handleIdentifier(mixin, expression)
@@ -6008,7 +5885,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(x, expression)
                                               listener: handleNoTypeArguments(-)
@@ -6034,7 +5910,7 @@
                 ensureSemicolon(1)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -6075,7 +5951,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -6088,7 +5964,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -6120,7 +5995,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -6133,7 +6008,6 @@
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           looksLikeFunctionBody(+)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               inPlainSync()
                               listener: handleIdentifier(native, expression)
@@ -6148,7 +6022,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(x, expression)
                                               listener: handleNoTypeArguments(-)
@@ -6174,7 +6047,7 @@
                 ensureSemicolon(1)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -6219,7 +6092,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -6232,7 +6105,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -6264,7 +6136,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -6274,7 +6146,6 @@
                     parseUnaryExpression(return, true, ConstantPatternContext.none)
                       parsePrimary(return, expression, ConstantPatternContext.none)
                         parseNewExpression(return)
-                          isNextIdentifier(new)
                           listener: beginNewExpression(new)
                           parseConstructorReference(new, ConstructorReferenceContext.New, null)
                             ensureIdentifier(new, constructorReference)
@@ -6297,7 +6168,6 @@
                                     parsePrimary((, expression, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                         parseSend((, expression, ConstantPatternContext.none)
-                                          isNextIdentifier(()
                                           ensureIdentifier((, expression)
                                             listener: handleIdentifier(x, expression)
                                           listener: handleNoTypeArguments(-)
@@ -6323,7 +6193,7 @@
                 ensureSemicolon(1)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -6368,7 +6238,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -6381,7 +6251,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -6413,7 +6282,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -6435,7 +6304,6 @@
                                 parsePrimary((, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                     parseSend((, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(()
                                       ensureIdentifier((, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments(-)
@@ -6461,7 +6329,7 @@
                 ensureSemicolon(1)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -6502,7 +6370,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -6515,7 +6383,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -6547,7 +6414,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -6560,7 +6427,6 @@
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           looksLikeFunctionBody(+)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               inPlainSync()
                               listener: handleIdentifier(of, expression)
@@ -6575,7 +6441,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(x, expression)
                                               listener: handleNoTypeArguments(-)
@@ -6601,7 +6466,7 @@
                 ensureSemicolon(1)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -6642,7 +6507,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -6655,7 +6520,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -6687,7 +6551,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -6700,7 +6564,6 @@
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           looksLikeFunctionBody(+)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               inPlainSync()
                               listener: handleIdentifier(on, expression)
@@ -6715,7 +6578,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(x, expression)
                                               listener: handleNoTypeArguments(-)
@@ -6741,7 +6603,7 @@
                 ensureSemicolon(1)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -6782,7 +6644,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -6795,7 +6657,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -6827,7 +6688,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -6840,7 +6701,6 @@
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           looksLikeFunctionBody(+)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               inPlainSync()
                               listener: handleIdentifier(operator, expression)
@@ -6855,7 +6715,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(x, expression)
                                               listener: handleNoTypeArguments(-)
@@ -6881,7 +6740,7 @@
                 ensureSemicolon(1)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -6922,7 +6781,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -6935,7 +6794,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -6967,7 +6825,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -6980,7 +6838,6 @@
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           looksLikeFunctionBody(+)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               inPlainSync()
                               listener: handleIdentifier(out, expression)
@@ -6995,7 +6852,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(x, expression)
                                               listener: handleNoTypeArguments(-)
@@ -7021,7 +6877,7 @@
                 ensureSemicolon(1)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -7062,7 +6918,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -7075,7 +6931,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -7107,7 +6962,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -7120,7 +6975,6 @@
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           looksLikeFunctionBody(+)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               inPlainSync()
                               listener: handleIdentifier(part, expression)
@@ -7135,7 +6989,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(x, expression)
                                               listener: handleNoTypeArguments(-)
@@ -7161,7 +7014,7 @@
                 ensureSemicolon(1)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -7202,7 +7055,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -7215,7 +7068,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -7247,7 +7099,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -7260,7 +7112,6 @@
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           looksLikeFunctionBody(+)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               inPlainSync()
                               listener: handleIdentifier(patch, expression)
@@ -7275,7 +7126,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(x, expression)
                                               listener: handleNoTypeArguments(-)
@@ -7301,7 +7151,7 @@
                 ensureSemicolon(1)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -7342,7 +7192,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -7355,7 +7205,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -7387,7 +7236,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -7400,7 +7249,6 @@
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           looksLikeFunctionBody(+)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               inPlainSync()
                               listener: handleIdentifier(required, expression)
@@ -7415,7 +7263,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(x, expression)
                                               listener: handleNoTypeArguments(-)
@@ -7441,7 +7288,7 @@
                 ensureSemicolon(1)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -7486,7 +7333,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -7499,7 +7346,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -7531,7 +7377,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -7542,7 +7388,6 @@
                       parsePrimary(return, expression, ConstantPatternContext.none)
                         inPlainSync()
                         parseSend(return, expression, ConstantPatternContext.none)
-                          isNextIdentifier(return)
                           ensureIdentifier(return, expression)
                             reportRecoverableErrorWithToken(rethrow, Template(ExpectedIdentifierButGotKeyword))
                               listener: handleRecoverableError(Message[ExpectedIdentifierButGotKeyword, 'rethrow' can't be used as an identifier because it's a keyword., Try renaming this to be an identifier that isn't a keyword., {lexeme: rethrow}], rethrow, rethrow)
@@ -7558,7 +7403,6 @@
                                       parsePrimary((, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                           parseSend((, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(()
                                             ensureIdentifier((, expression)
                                               listener: handleIdentifier(x, expression)
                                             listener: handleNoTypeArguments(-)
@@ -7584,7 +7428,7 @@
                 ensureSemicolon(1)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -7629,7 +7473,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -7642,7 +7486,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -7674,7 +7517,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -7696,7 +7539,6 @@
                                     parsePrimary((, expression, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                         parseSend((, expression, ConstantPatternContext.none)
-                                          isNextIdentifier(()
                                           ensureIdentifier((, expression)
                                             listener: handleIdentifier(x, expression)
                                           listener: handleNoTypeArguments(-)
@@ -7722,7 +7564,7 @@
                 ensureSemicolon(1)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -7763,7 +7605,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -7776,7 +7618,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -7808,7 +7649,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -7821,7 +7662,6 @@
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           looksLikeFunctionBody(+)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               inPlainSync()
                               listener: handleIdentifier(set, expression)
@@ -7836,7 +7676,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(x, expression)
                                               listener: handleNoTypeArguments(-)
@@ -7862,7 +7701,7 @@
                 ensureSemicolon(1)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -7903,7 +7742,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -7916,7 +7755,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -7948,7 +7786,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -7961,7 +7799,6 @@
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           looksLikeFunctionBody(+)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               inPlainSync()
                               listener: handleIdentifier(show, expression)
@@ -7976,7 +7813,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(x, expression)
                                               listener: handleNoTypeArguments(-)
@@ -8002,7 +7838,7 @@
                 ensureSemicolon(1)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -8043,7 +7879,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -8056,7 +7892,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -8088,7 +7923,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -8101,7 +7936,6 @@
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           looksLikeFunctionBody(+)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               inPlainSync()
                               listener: handleIdentifier(source, expression)
@@ -8116,7 +7950,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(x, expression)
                                               listener: handleNoTypeArguments(-)
@@ -8142,7 +7975,7 @@
                 ensureSemicolon(1)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -8183,7 +8016,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -8196,7 +8029,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -8228,7 +8060,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -8241,7 +8073,6 @@
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           looksLikeFunctionBody(+)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               inPlainSync()
                               listener: handleIdentifier(static, expression)
@@ -8256,7 +8087,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(x, expression)
                                               listener: handleNoTypeArguments(-)
@@ -8282,7 +8112,7 @@
                 ensureSemicolon(1)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -8325,7 +8155,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -8338,7 +8168,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -8370,7 +8199,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -8391,7 +8220,6 @@
                                     parsePrimary((, expression, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                         parseSend((, expression, ConstantPatternContext.none)
-                                          isNextIdentifier(()
                                           ensureIdentifier((, expression)
                                             listener: handleIdentifier(x, expression)
                                           listener: handleNoTypeArguments(-)
@@ -8417,7 +8245,7 @@
                 ensureSemicolon(1)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -8462,7 +8290,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -8475,7 +8303,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -8507,7 +8334,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -8518,7 +8345,6 @@
                       parsePrimary(return, expression, ConstantPatternContext.none)
                         inPlainSync()
                         parseSend(return, expression, ConstantPatternContext.none)
-                          isNextIdentifier(return)
                           ensureIdentifier(return, expression)
                             reportRecoverableErrorWithToken(switch, Template(ExpectedIdentifier))
                               listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got 'switch'., Try inserting an identifier before 'switch'., {lexeme: switch}], switch, switch)
@@ -8534,7 +8360,7 @@
                   rewriter()
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement(;)
             parseStatementX(;)
               parseSwitchStatement(;)
@@ -8547,7 +8373,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(-)
@@ -8571,10 +8396,10 @@
                       rewriter()
                       rewriter()
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(0, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, +)
+          notEofOrType(CLOSE_CURLY_BRACKET, +)
           parseStatement(})
             parseStatementX(})
               parseExpressionStatementOrDeclaration(}, null)
@@ -8591,7 +8416,6 @@
                           parsePrimary(}, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(}, expression, ConstantPatternContext.none)
                               parseSend(}, expression, ConstantPatternContext.none)
-                                isNextIdentifier(})
                                 ensureIdentifier(}, expression)
                                   listener: handleIdentifier(, expression)
                                 listener: handleNoTypeArguments(+)
@@ -8607,7 +8431,7 @@
                         listener: endBinaryExpression(+, 1)
                     ensureSemicolon(1)
                     listener: handleExpressionStatement(+, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(4, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -8648,7 +8472,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -8661,7 +8485,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -8693,7 +8516,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -8706,7 +8529,6 @@
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           looksLikeFunctionBody(+)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               inPlainSync()
                               listener: handleIdentifier(sync, expression)
@@ -8721,7 +8543,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(x, expression)
                                               listener: handleNoTypeArguments(-)
@@ -8747,7 +8568,7 @@
                 ensureSemicolon(1)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -8790,7 +8611,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -8803,7 +8624,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -8835,7 +8655,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -8856,7 +8676,6 @@
                                     parsePrimary((, expression, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                         parseSend((, expression, ConstantPatternContext.none)
-                                          isNextIdentifier(()
                                           ensureIdentifier((, expression)
                                             listener: handleIdentifier(x, expression)
                                           listener: handleNoTypeArguments(-)
@@ -8882,7 +8701,7 @@
                 ensureSemicolon(1)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -8927,7 +8746,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -8940,7 +8759,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -8972,7 +8790,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -8992,7 +8810,6 @@
                                       parsePrimary((, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                           parseSend((, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(()
                                             ensureIdentifier((, expression)
                                               listener: handleIdentifier(x, expression)
                                             listener: handleNoTypeArguments(-)
@@ -9019,7 +8836,7 @@
                 ensureSemicolon(1)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -9064,7 +8881,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -9077,7 +8894,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -9109,7 +8925,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -9131,7 +8947,6 @@
                                 parsePrimary((, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                     parseSend((, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(()
                                       ensureIdentifier((, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments(-)
@@ -9157,7 +8972,7 @@
                 ensureSemicolon(1)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -9202,7 +9017,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -9215,7 +9030,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -9247,7 +9061,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -9258,7 +9072,6 @@
                       parsePrimary(return, expression, ConstantPatternContext.none)
                         inPlainSync()
                         parseSend(return, expression, ConstantPatternContext.none)
-                          isNextIdentifier(return)
                           ensureIdentifier(return, expression)
                             reportRecoverableErrorWithToken(try, Template(ExpectedIdentifier))
                               listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got 'try'., Try inserting an identifier before 'try'., {lexeme: try}], try, try)
@@ -9274,7 +9087,7 @@
                   rewriter()
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, try)
+          notEofOrType(CLOSE_CURLY_BRACKET, try)
           parseStatement(;)
             parseStatementX(;)
               parseTryStatement(;)
@@ -9287,12 +9100,12 @@
                       rewriter()
                       rewriter()
                   listener: beginBlock({, BlockKind(try statement))
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlock(0, {, }, BlockKind(try statement))
                 reportRecoverableError(try, OnlyTry)
                   listener: handleRecoverableError(OnlyTry, try, try)
                 listener: endTryStatement(0, try, null, })
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(})
             parseStatementX(})
               parseExpressionStatementOrDeclaration(}, null)
@@ -9312,7 +9125,6 @@
                                       parsePrimary((, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                           parseSend((, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(()
                                             ensureIdentifier((, expression)
                                               listener: handleIdentifier(x, expression)
                                             listener: handleNoTypeArguments(-)
@@ -9337,7 +9149,7 @@
                         listener: endBinaryExpression(+, 1)
                     ensureSemicolon(1)
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(4, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -9378,7 +9190,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -9391,7 +9203,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -9423,7 +9234,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -9436,7 +9247,6 @@
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           looksLikeFunctionBody(+)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               inPlainSync()
                               listener: handleIdentifier(typedef, expression)
@@ -9451,7 +9261,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(x, expression)
                                               listener: handleNoTypeArguments(-)
@@ -9477,7 +9286,7 @@
                 ensureSemicolon(1)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -9522,7 +9331,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -9535,7 +9344,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -9567,7 +9375,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -9578,7 +9386,6 @@
                       parsePrimary(return, expression, ConstantPatternContext.none)
                         inPlainSync()
                         parseSend(return, expression, ConstantPatternContext.none)
-                          isNextIdentifier(return)
                           ensureIdentifier(return, expression)
                             reportRecoverableErrorWithToken(var, Template(ExpectedIdentifier))
                               listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got 'var'., Try inserting an identifier before 'var'., {lexeme: var}], var, var)
@@ -9594,7 +9401,7 @@
                   rewriter()
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(var, ;, null, var, null, null)
@@ -9619,7 +9426,7 @@
                       listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], (, ()
                     rewriter()
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, x)
+          notEofOrType(CLOSE_CURLY_BRACKET, x)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -9631,7 +9438,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(x, expression)
                               listener: handleNoTypeArguments(-)
@@ -9650,7 +9456,7 @@
                       listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], 1, 1)
                     rewriter()
                   listener: handleExpressionStatement(x, ;)
-          notEofOrValue(}, ))
+          notEofOrType(CLOSE_CURLY_BRACKET, ))
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -9662,7 +9468,6 @@
                         parseUnaryExpression(;, true, ConstantPatternContext.none)
                           parsePrimary(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 reportRecoverableErrorWithToken(), Template(ExpectedIdentifier))
                                   listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got ')'., Try inserting an identifier before ')'., {lexeme: )}], ), ))
@@ -9679,7 +9484,7 @@
                     listener: handleExpressionStatement(), ;)
           reportRecoverableError(;, Message[UnexpectedToken, Unexpected token ';'., null, {lexeme: ;}])
             listener: handleRecoverableError(Message[UnexpectedToken, Unexpected token ';'., null, {lexeme: ;}], ), ))
-          notEofOrValue(}, +)
+          notEofOrType(CLOSE_CURLY_BRACKET, +)
           parseStatement())
             parseStatementX())
               parseExpressionStatementOrDeclaration(), null)
@@ -9696,7 +9501,6 @@
                           parsePrimary(), expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(), expression, ConstantPatternContext.none)
                               parseSend(), expression, ConstantPatternContext.none)
-                                isNextIdentifier())
                                 ensureIdentifier(), expression)
                                   listener: handleIdentifier(, expression)
                                 listener: handleNoTypeArguments(+)
@@ -9712,7 +9516,7 @@
                         listener: endBinaryExpression(+, 1)
                     ensureSemicolon(1)
                     listener: handleExpressionStatement(+, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(6, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -9757,7 +9561,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -9770,7 +9574,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -9802,7 +9605,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -9813,7 +9616,6 @@
                       parsePrimary(return, expression, ConstantPatternContext.none)
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               reportRecoverableErrorWithToken(void, Template(ExpectedIdentifier))
                                 listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got 'void'., Try inserting an identifier before 'void'., {lexeme: void}], void, void)
@@ -9829,7 +9631,7 @@
                   rewriter()
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, void)
+          notEofOrType(CLOSE_CURLY_BRACKET, void)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -9855,7 +9657,7 @@
                         listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], (, ()
                       rewriter()
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, x)
+          notEofOrType(CLOSE_CURLY_BRACKET, x)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -9867,7 +9669,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(x, expression)
                               listener: handleNoTypeArguments(-)
@@ -9886,7 +9687,7 @@
                       listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], 1, 1)
                     rewriter()
                   listener: handleExpressionStatement(x, ;)
-          notEofOrValue(}, ))
+          notEofOrType(CLOSE_CURLY_BRACKET, ))
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -9898,7 +9699,6 @@
                         parseUnaryExpression(;, true, ConstantPatternContext.none)
                           parsePrimary(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 reportRecoverableErrorWithToken(), Template(ExpectedIdentifier))
                                   listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got ')'., Try inserting an identifier before ')'., {lexeme: )}], ), ))
@@ -9915,7 +9715,7 @@
                     listener: handleExpressionStatement(), ;)
           reportRecoverableError(;, Message[UnexpectedToken, Unexpected token ';'., null, {lexeme: ;}])
             listener: handleRecoverableError(Message[UnexpectedToken, Unexpected token ';'., null, {lexeme: ;}], ), ))
-          notEofOrValue(}, +)
+          notEofOrType(CLOSE_CURLY_BRACKET, +)
           parseStatement())
             parseStatementX())
               parseExpressionStatementOrDeclaration(), null)
@@ -9932,7 +9732,6 @@
                           parsePrimary(), expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(), expression, ConstantPatternContext.none)
                               parseSend(), expression, ConstantPatternContext.none)
-                                isNextIdentifier())
                                 ensureIdentifier(), expression)
                                   listener: handleIdentifier(, expression)
                                 listener: handleNoTypeArguments(+)
@@ -9948,7 +9747,7 @@
                         listener: endBinaryExpression(+, 1)
                     ensureSemicolon(1)
                     listener: handleExpressionStatement(+, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(6, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -9993,7 +9792,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -10006,7 +9805,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -10038,7 +9836,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -10049,7 +9847,6 @@
                       parsePrimary(return, expression, ConstantPatternContext.none)
                         inPlainSync()
                         parseSend(return, expression, ConstantPatternContext.none)
-                          isNextIdentifier(return)
                           ensureIdentifier(return, expression)
                             reportRecoverableErrorWithToken(while, Template(ExpectedIdentifier))
                               listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got 'while'., Try inserting an identifier before 'while'., {lexeme: while}], while, while)
@@ -10065,7 +9862,7 @@
                   rewriter()
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, while)
+          notEofOrType(CLOSE_CURLY_BRACKET, while)
           parseStatement(;)
             parseStatementX(;)
               parseWhileStatement(;)
@@ -10078,7 +9875,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(-)
@@ -10111,7 +9907,6 @@
                                 parsePrimary(), expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(), expression, ConstantPatternContext.none)
                                     parseSend(), expression, ConstantPatternContext.none)
-                                      isNextIdentifier())
                                       ensureIdentifier(), expression)
                                         listener: handleIdentifier(, expression)
                                       listener: handleNoTypeArguments(+)
@@ -10129,7 +9924,7 @@
                           listener: handleExpressionStatement(+, ;)
                 listener: endWhileStatementBody(;)
                 listener: endWhileStatement(while, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(3, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -10174,7 +9969,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -10187,7 +9982,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -10219,7 +10013,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -10230,7 +10024,6 @@
                       parsePrimary(return, expression, ConstantPatternContext.none)
                         inPlainSync()
                         parseSend(return, expression, ConstantPatternContext.none)
-                          isNextIdentifier(return)
                           ensureIdentifier(return, expression)
                             reportRecoverableErrorWithToken(with, Template(ExpectedIdentifierButGotKeyword))
                               listener: handleRecoverableError(Message[ExpectedIdentifierButGotKeyword, 'with' can't be used as an identifier because it's a keyword., Try renaming this to be an identifier that isn't a keyword., {lexeme: with}], with, with)
@@ -10246,7 +10039,6 @@
                                       parsePrimary((, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                           parseSend((, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(()
                                             ensureIdentifier((, expression)
                                               listener: handleIdentifier(x, expression)
                                             listener: handleNoTypeArguments(-)
@@ -10272,7 +10064,7 @@
                 ensureSemicolon(1)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -10313,7 +10105,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -10326,7 +10118,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -10358,7 +10149,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -10371,7 +10162,6 @@
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           looksLikeFunctionBody(+)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               inPlainSync()
                               listener: handleIdentifier(yield, expression)
@@ -10386,7 +10176,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(x, expression)
                                               listener: handleNoTypeArguments(-)
@@ -10412,7 +10201,7 @@
                 ensureSemicolon(1)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/method_called_with.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/method_called_with.dart.intertwined.expect
index 5587d3f..3f19834 100644
--- a/pkg/front_end/parser_testcases/error_recovery/method_called_with.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/method_called_with.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(C, DeclarationKind.Class, C)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, C)
               parseMetadataStar({)
                 listener: beginMetadataStar(int)
@@ -69,7 +69,7 @@
                     inGenerator()
                 listener: endClassMethod(null, int, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, C)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -97,7 +97,7 @@
                   listener: endFieldInitializer(=, 7)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, C)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -138,7 +138,7 @@
                     inGenerator()
                 listener: endClassMethod(get, int, =>, null, ;)
               listener: endMember()
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, C)
               parseMetadataStar(;)
                 listener: beginMetadataStar(void)
@@ -181,11 +181,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassMethod(set, void, (, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 4, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/method_called_with_prime.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/method_called_with_prime.dart.intertwined.expect
index 77bf41b..3c848b2 100644
--- a/pkg/front_end/parser_testcases/error_recovery/method_called_with_prime.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/method_called_with_prime.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(C, DeclarationKind.Class, C)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, C)
               parseMetadataStar({)
                 listener: beginMetadataStar(int)
@@ -65,7 +65,7 @@
                     inGenerator()
                 listener: endClassMethod(null, int, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, C)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -89,7 +89,7 @@
                   listener: endFieldInitializer(=, 7)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, C)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -126,7 +126,7 @@
                     inGenerator()
                 listener: endClassMethod(get, int, =>, null, ;)
               listener: endMember()
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, C)
               parseMetadataStar(;)
                 listener: beginMetadataStar(void)
@@ -165,11 +165,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassMethod(set, void, (, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 4, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/method_called_with_prime2.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/method_called_with_prime2.dart.intertwined.expect
index 5bd556c..d73e6d0 100644
--- a/pkg/front_end/parser_testcases/error_recovery/method_called_with_prime2.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/method_called_with_prime2.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(B, DeclarationKind.Class, B)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -75,7 +75,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(M1, DeclarationKind.Class, M1)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, foo)
+            notEofOrType(CLOSE_CURLY_BRACKET, foo)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, M1)
               parseMetadataStar({)
                 listener: beginMetadataStar(foo)
@@ -98,7 +98,7 @@
                   rewriter()
                 listener: endClassFields(null, null, null, null, null, null, null, 1, foo, ;)
               listener: endMember()
-            notEofOrValue(}, class)
+            notEofOrType(CLOSE_CURLY_BRACKET, class)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, M1)
               parseMetadataStar(;)
                 listener: beginMetadataStar(class)
@@ -110,7 +110,7 @@
                     listener: handleRecoverableError(ClassInClass, class, class)
                   listener: handleInvalidMember(class)
                   listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 2, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/missing_identifier_in_type_argument_bad_1.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/missing_identifier_in_type_argument_bad_1.dart.intertwined.expect
index bbf9889..3fa7be6 100644
--- a/pkg/front_end/parser_testcases/error_recovery/missing_identifier_in_type_argument_bad_1.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/missing_identifier_in_type_argument_bad_1.dart.intertwined.expect
@@ -36,7 +36,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, Map)
+          notEofOrType(CLOSE_CURLY_BRACKET, Map)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -76,7 +76,7 @@
                     listener: endInitializedIdentifier(b)
                   ensureSemicolon(})
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(foo, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/missing_identifier_in_type_argument_bad_2.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/missing_identifier_in_type_argument_bad_2.dart.intertwined.expect
index 871a5f8..689fe35 100644
--- a/pkg/front_end/parser_testcases/error_recovery/missing_identifier_in_type_argument_bad_2.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/missing_identifier_in_type_argument_bad_2.dart.intertwined.expect
@@ -36,7 +36,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, Map)
+          notEofOrType(CLOSE_CURLY_BRACKET, Map)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -76,7 +76,7 @@
                     listener: endInitializedIdentifier(c)
                   ensureSemicolon(})
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(foo, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/missing_identifier_in_type_argument_ok.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/missing_identifier_in_type_argument_ok.dart.intertwined.expect
index 196d318..0a5b06c 100644
--- a/pkg/front_end/parser_testcases/error_recovery/missing_identifier_in_type_argument_ok.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/missing_identifier_in_type_argument_ok.dart.intertwined.expect
@@ -36,7 +36,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, Map)
+          notEofOrType(CLOSE_CURLY_BRACKET, Map)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -73,7 +73,7 @@
                     listener: endInitializedIdentifier(a)
                   ensureSemicolon(})
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(foo, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/symbols.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/symbols.dart.intertwined.expect
index 21fb8df..4a4756b 100644
--- a/pkg/front_end/parser_testcases/error_recovery/symbols.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/symbols.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -43,7 +43,7 @@
                               listener: endLiteralSymbol(#, 1)
                     ensureSemicolon(void)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -61,7 +61,6 @@
                         parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                             parseSend(., expressionContinuation, ConstantPatternContext.none)
-                              isNextIdentifier(.)
                               ensureIdentifier(., expressionContinuation)
                                 listener: handleIdentifier(foo, expressionContinuation)
                               listener: handleNoTypeArguments(;)
@@ -71,7 +70,7 @@
                         listener: handleEndingBinaryExpression(., foo)
                     ensureSemicolon(foo)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -93,7 +92,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(void)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -113,7 +112,7 @@
                               listener: endLiteralSymbol(#, 1)
                     ensureSemicolon(assert)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -133,7 +132,7 @@
                               listener: endLiteralSymbol(#, 1)
                     ensureSemicolon(break)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -153,7 +152,7 @@
                               listener: endLiteralSymbol(#, 1)
                     ensureSemicolon(case)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -173,7 +172,7 @@
                               listener: endLiteralSymbol(#, 1)
                     ensureSemicolon(catch)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -193,7 +192,7 @@
                               listener: endLiteralSymbol(#, 1)
                     ensureSemicolon(class)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -213,7 +212,7 @@
                               listener: endLiteralSymbol(#, 1)
                     ensureSemicolon(const)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -233,7 +232,7 @@
                               listener: endLiteralSymbol(#, 1)
                     ensureSemicolon(continue)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -253,7 +252,7 @@
                               listener: endLiteralSymbol(#, 1)
                     ensureSemicolon(default)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -273,7 +272,7 @@
                               listener: endLiteralSymbol(#, 1)
                     ensureSemicolon(do)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -293,7 +292,7 @@
                               listener: endLiteralSymbol(#, 1)
                     ensureSemicolon(else)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -313,7 +312,7 @@
                               listener: endLiteralSymbol(#, 1)
                     ensureSemicolon(enum)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -333,7 +332,7 @@
                               listener: endLiteralSymbol(#, 1)
                     ensureSemicolon(extends)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -353,7 +352,7 @@
                               listener: endLiteralSymbol(#, 1)
                     ensureSemicolon(false)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -373,7 +372,7 @@
                               listener: endLiteralSymbol(#, 1)
                     ensureSemicolon(final)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -393,7 +392,7 @@
                               listener: endLiteralSymbol(#, 1)
                     ensureSemicolon(finally)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -413,7 +412,7 @@
                               listener: endLiteralSymbol(#, 1)
                     ensureSemicolon(for)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -433,7 +432,7 @@
                               listener: endLiteralSymbol(#, 1)
                     ensureSemicolon(if)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -453,7 +452,7 @@
                               listener: endLiteralSymbol(#, 1)
                     ensureSemicolon(in)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -473,7 +472,7 @@
                               listener: endLiteralSymbol(#, 1)
                     ensureSemicolon(is)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -493,7 +492,7 @@
                               listener: endLiteralSymbol(#, 1)
                     ensureSemicolon(new)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -513,7 +512,7 @@
                               listener: endLiteralSymbol(#, 1)
                     ensureSemicolon(null)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -533,7 +532,7 @@
                               listener: endLiteralSymbol(#, 1)
                     ensureSemicolon(rethrow)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -553,7 +552,7 @@
                               listener: endLiteralSymbol(#, 1)
                     ensureSemicolon(return)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -573,7 +572,7 @@
                               listener: endLiteralSymbol(#, 1)
                     ensureSemicolon(super)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -593,7 +592,7 @@
                               listener: endLiteralSymbol(#, 1)
                     ensureSemicolon(switch)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -613,7 +612,7 @@
                               listener: endLiteralSymbol(#, 1)
                     ensureSemicolon(this)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -633,7 +632,7 @@
                               listener: endLiteralSymbol(#, 1)
                     ensureSemicolon(throw)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -653,7 +652,7 @@
                               listener: endLiteralSymbol(#, 1)
                     ensureSemicolon(true)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -673,7 +672,7 @@
                               listener: endLiteralSymbol(#, 1)
                     ensureSemicolon(try)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -693,7 +692,7 @@
                               listener: endLiteralSymbol(#, 1)
                     ensureSemicolon(var)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -713,7 +712,7 @@
                               listener: endLiteralSymbol(#, 1)
                     ensureSemicolon(while)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -733,7 +732,7 @@
                               listener: endLiteralSymbol(#, 1)
                     ensureSemicolon(with)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -755,7 +754,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(assert)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -777,7 +776,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(break)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -799,7 +798,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(case)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -821,7 +820,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(catch)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -843,7 +842,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(class)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -865,7 +864,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(const)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -887,7 +886,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(continue)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -909,7 +908,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(default)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -931,7 +930,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(do)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -953,7 +952,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(else)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -975,7 +974,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(enum)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -997,7 +996,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(extends)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1019,7 +1018,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(false)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1041,7 +1040,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(final)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1063,7 +1062,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(finally)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1085,7 +1084,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(for)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1107,7 +1106,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(if)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1129,7 +1128,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(in)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1151,7 +1150,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(is)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1173,7 +1172,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(new)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1195,7 +1194,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(null)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1217,7 +1216,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(rethrow)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1239,7 +1238,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(return)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1261,7 +1260,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(super)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1283,7 +1282,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(switch)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1305,7 +1304,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(this)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1327,7 +1326,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(throw)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1349,7 +1348,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(true)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1371,7 +1370,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(try)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1393,7 +1392,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(var)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1415,7 +1414,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(while)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1437,7 +1436,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(with)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1459,7 +1458,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(foo)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1481,7 +1480,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(foo)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1503,7 +1502,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(foo)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1525,7 +1524,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(foo)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1547,7 +1546,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(foo)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1569,7 +1568,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(foo)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1591,7 +1590,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(foo)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1613,7 +1612,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(foo)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1635,7 +1634,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(foo)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1657,7 +1656,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(foo)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1679,7 +1678,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(foo)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1701,7 +1700,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(foo)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1723,7 +1722,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(foo)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1745,7 +1744,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(foo)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1767,7 +1766,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(foo)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1789,7 +1788,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(foo)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1811,7 +1810,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(foo)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1833,7 +1832,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(foo)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1855,7 +1854,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(foo)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1877,7 +1876,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(foo)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1899,7 +1898,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(foo)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1921,7 +1920,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(foo)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1943,7 +1942,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(foo)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1965,7 +1964,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(foo)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1987,7 +1986,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(foo)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -2009,7 +2008,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(foo)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -2031,7 +2030,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(foo)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -2053,7 +2052,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(foo)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -2075,7 +2074,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(foo)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -2097,7 +2096,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(foo)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -2119,7 +2118,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(foo)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, #)
+          notEofOrType(CLOSE_CURLY_BRACKET, #)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -2141,7 +2140,7 @@
                               listener: endLiteralSymbol(#, 2)
                     ensureSemicolon(foo)
                     listener: handleExpressionStatement(#, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(99, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/utf_16_le_content.crash_dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/utf_16_le_content.crash_dart.intertwined.expect
index e1a6a10..2899fa7 100644
--- a/pkg/front_end/parser_testcases/error_recovery/utf_16_le_content.crash_dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/utf_16_le_content.crash_dart.intertwined.expect
Binary files differ
diff --git a/pkg/front_end/parser_testcases/error_recovery/with_outline/typing_01.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/with_outline/typing_01.dart.intertwined.expect
index f4912c2..4684d08 100644
--- a/pkg/front_end/parser_testcases/error_recovery/with_outline/typing_01.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/with_outline/typing_01.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Foo, DeclarationKind.Class, Foo)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Foo)
               parseMetadataStar({)
                 listener: beginMetadataStar(void)
@@ -52,7 +52,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -87,7 +87,7 @@
                             parseBlock(), BlockKind(statement))
                               ensureBlock(), BlockKind(statement))
                               listener: beginBlock({, BlockKind(statement))
-                              notEofOrValue(}, if)
+                              notEofOrType(CLOSE_CURLY_BRACKET, if)
                               parseStatement({)
                                 parseStatementX({)
                                   parseIfStatement({)
@@ -122,19 +122,19 @@
                                         parseBlock(), BlockKind(statement))
                                           ensureBlock(), BlockKind(statement))
                                           listener: beginBlock({, BlockKind(statement))
-                                          notEofOrValue(}, })
+                                          notEofOrType(CLOSE_CURLY_BRACKET, })
                                           listener: endBlock(0, {, }, BlockKind(statement))
                                     listener: endThenStatement({, })
                                     listener: endIfStatement(if, null, })
-                              notEofOrValue(}, })
+                              notEofOrType(CLOSE_CURLY_BRACKET, })
                               listener: endBlock(1, {, }, BlockKind(statement))
                         listener: endThenStatement({, })
                         listener: endIfStatement(if, null, })
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(null, void, (, null, })
               listener: endMember()
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(void)
@@ -161,11 +161,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassMethod(null, void, (, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 2, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -192,7 +192,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Bar, DeclarationKind.Class, Bar)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Bar)
               parseMetadataStar({)
                 listener: beginMetadataStar(void)
@@ -219,11 +219,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassMethod(null, void, (, null, })
               listener: endMember()
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Bar)
               parseMetadataStar(})
                 listener: beginMetadataStar(void)
@@ -250,11 +250,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassMethod(null, void, (, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 2, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/with_outline/typing_02.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/with_outline/typing_02.dart.intertwined.expect
index 0a8b046..4e37e56 100644
--- a/pkg/front_end/parser_testcases/error_recovery/with_outline/typing_02.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/with_outline/typing_02.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Foo, DeclarationKind.Class, Foo)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Foo)
               parseMetadataStar({)
                 listener: beginMetadataStar(void)
@@ -52,7 +52,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -87,15 +87,15 @@
                             parseBlock(), BlockKind(statement))
                               ensureBlock(), BlockKind(statement))
                               listener: beginBlock({, BlockKind(statement))
-                              notEofOrValue(}, })
+                              notEofOrType(CLOSE_CURLY_BRACKET, })
                               listener: endBlock(0, {, }, BlockKind(statement))
                         listener: endThenStatement({, })
                         listener: endIfStatement(if, null, })
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(null, void, (, null, })
               listener: endMember()
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(void)
@@ -122,11 +122,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassMethod(null, void, (, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 2, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -153,7 +153,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -180,7 +180,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/with_outline/typing_03.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/with_outline/typing_03.dart.intertwined.expect
index c0a7f16a4..cfc9b7c 100644
--- a/pkg/front_end/parser_testcases/error_recovery/with_outline/typing_03.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/with_outline/typing_03.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Foo, DeclarationKind.Class, Foo)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Foo)
               parseMetadataStar({)
                 listener: beginMetadataStar(void)
@@ -52,7 +52,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -87,7 +87,7 @@
                             parseBlock(), BlockKind(statement))
                               ensureBlock(), BlockKind(statement))
                               listener: beginBlock({, BlockKind(statement))
-                              notEofOrValue(}, if)
+                              notEofOrType(CLOSE_CURLY_BRACKET, if)
                               parseStatement({)
                                 parseStatementX({)
                                   parseIfStatement({)
@@ -122,7 +122,7 @@
                                         parseBlock(), BlockKind(statement))
                                           ensureBlock(), BlockKind(statement))
                                           listener: beginBlock({, BlockKind(statement))
-                                          notEofOrValue(}, if)
+                                          notEofOrType(CLOSE_CURLY_BRACKET, if)
                                           parseStatement({)
                                             parseStatementX({)
                                               parseIfStatement({)
@@ -157,7 +157,7 @@
                                                     parseBlock(), BlockKind(statement))
                                                       ensureBlock(), BlockKind(statement))
                                                       listener: beginBlock({, BlockKind(statement))
-                                                      notEofOrValue(}, if)
+                                                      notEofOrType(CLOSE_CURLY_BRACKET, if)
                                                       parseStatement({)
                                                         parseStatementX({)
                                                           parseIfStatement({)
@@ -192,27 +192,27 @@
                                                                 parseBlock(), BlockKind(statement))
                                                                   ensureBlock(), BlockKind(statement))
                                                                   listener: beginBlock({, BlockKind(statement))
-                                                                  notEofOrValue(}, })
+                                                                  notEofOrType(CLOSE_CURLY_BRACKET, })
                                                                   listener: endBlock(0, {, }, BlockKind(statement))
                                                             listener: endThenStatement({, })
                                                             listener: endIfStatement(if, null, })
-                                                      notEofOrValue(}, })
+                                                      notEofOrType(CLOSE_CURLY_BRACKET, })
                                                       listener: endBlock(1, {, }, BlockKind(statement))
                                                 listener: endThenStatement({, })
                                                 listener: endIfStatement(if, null, })
-                                          notEofOrValue(}, })
+                                          notEofOrType(CLOSE_CURLY_BRACKET, })
                                           listener: endBlock(1, {, }, BlockKind(statement))
                                     listener: endThenStatement({, })
                                     listener: endIfStatement(if, null, })
-                              notEofOrValue(}, })
+                              notEofOrType(CLOSE_CURLY_BRACKET, })
                               listener: endBlock(1, {, }, BlockKind(statement))
                         listener: endThenStatement({, })
                         listener: endIfStatement(if, null, })
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(null, void, (, null, })
               listener: endMember()
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(void)
@@ -239,11 +239,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassMethod(null, void, (, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 2, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -270,7 +270,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Bar, DeclarationKind.Class, Bar)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Bar)
               parseMetadataStar({)
                 listener: beginMetadataStar(void)
@@ -297,11 +297,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassMethod(null, void, (, null, })
               listener: endMember()
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Bar)
               parseMetadataStar(})
                 listener: beginMetadataStar(void)
@@ -328,11 +328,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassMethod(null, void, (, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 2, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/with_outline/typing_04.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/with_outline/typing_04.dart.intertwined.expect
index 3872a52..59644b8 100644
--- a/pkg/front_end/parser_testcases/error_recovery/with_outline/typing_04.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/with_outline/typing_04.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Foo, DeclarationKind.Class, Foo)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Foo)
               parseMetadataStar({)
                 listener: beginMetadataStar(void)
@@ -52,7 +52,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -87,7 +87,7 @@
                             parseBlock(), BlockKind(statement))
                               ensureBlock(), BlockKind(statement))
                               listener: beginBlock({, BlockKind(statement))
-                              notEofOrValue(}, if)
+                              notEofOrType(CLOSE_CURLY_BRACKET, if)
                               parseStatement({)
                                 parseStatementX({)
                                   parseIfStatement({)
@@ -122,7 +122,7 @@
                                         parseBlock(), BlockKind(statement))
                                           ensureBlock(), BlockKind(statement))
                                           listener: beginBlock({, BlockKind(statement))
-                                          notEofOrValue(}, if)
+                                          notEofOrType(CLOSE_CURLY_BRACKET, if)
                                           parseStatement({)
                                             parseStatementX({)
                                               parseIfStatement({)
@@ -157,7 +157,7 @@
                                                     parseBlock(), BlockKind(statement))
                                                       ensureBlock(), BlockKind(statement))
                                                       listener: beginBlock({, BlockKind(statement))
-                                                      notEofOrValue(}, var)
+                                                      notEofOrType(CLOSE_CURLY_BRACKET, var)
                                                       parseStatement({)
                                                         parseStatementX({)
                                                           parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
@@ -213,23 +213,23 @@
                                                                   listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], 4, 4)
                                                                 rewriter()
                                                               listener: endVariablesDeclaration(1, ;)
-                                                      notEofOrValue(}, })
+                                                      notEofOrType(CLOSE_CURLY_BRACKET, })
                                                       listener: endBlock(1, {, }, BlockKind(statement))
                                                 listener: endThenStatement({, })
                                                 listener: endIfStatement(if, null, })
-                                          notEofOrValue(}, })
+                                          notEofOrType(CLOSE_CURLY_BRACKET, })
                                           listener: endBlock(1, {, }, BlockKind(statement))
                                     listener: endThenStatement({, })
                                     listener: endIfStatement(if, null, })
-                              notEofOrValue(}, })
+                              notEofOrType(CLOSE_CURLY_BRACKET, })
                               listener: endBlock(1, {, }, BlockKind(statement))
                         listener: endThenStatement({, })
                         listener: endIfStatement(if, null, })
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(null, void, (, null, })
               listener: endMember()
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(void)
@@ -256,11 +256,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassMethod(null, void, (, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 2, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -287,7 +287,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Bar, DeclarationKind.Class, Bar)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Bar)
               parseMetadataStar({)
                 listener: beginMetadataStar(void)
@@ -314,11 +314,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassMethod(null, void, (, null, })
               listener: endMember()
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Bar)
               parseMetadataStar(})
                 listener: beginMetadataStar(void)
@@ -345,11 +345,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassMethod(null, void, (, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 2, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/with_outline/typing_05.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/with_outline/typing_05.dart.intertwined.expect
index e3f6bca..7fa6b9b 100644
--- a/pkg/front_end/parser_testcases/error_recovery/with_outline/typing_05.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/with_outline/typing_05.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Foo, DeclarationKind.Class, Foo)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Foo)
               parseMetadataStar({)
                 listener: beginMetadataStar(void)
@@ -52,7 +52,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -87,7 +87,7 @@
                             parseBlock(), BlockKind(statement))
                               ensureBlock(), BlockKind(statement))
                               listener: beginBlock({, BlockKind(statement))
-                              notEofOrValue(}, if)
+                              notEofOrType(CLOSE_CURLY_BRACKET, if)
                               parseStatement({)
                                 parseStatementX({)
                                   parseIfStatement({)
@@ -122,7 +122,7 @@
                                         parseBlock(), BlockKind(statement))
                                           ensureBlock(), BlockKind(statement))
                                           listener: beginBlock({, BlockKind(statement))
-                                          notEofOrValue(}, if)
+                                          notEofOrType(CLOSE_CURLY_BRACKET, if)
                                           parseStatement({)
                                             parseStatementX({)
                                               parseIfStatement({)
@@ -157,7 +157,7 @@
                                                     parseBlock(), BlockKind(statement))
                                                       ensureBlock(), BlockKind(statement))
                                                       listener: beginBlock({, BlockKind(statement))
-                                                      notEofOrValue(}, var)
+                                                      notEofOrType(CLOSE_CURLY_BRACKET, var)
                                                       parseStatement({)
                                                         parseStatementX({)
                                                           parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
@@ -216,23 +216,23 @@
                                                                   listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], 4, 4)
                                                                 rewriter()
                                                               listener: endVariablesDeclaration(1, ;)
-                                                      notEofOrValue(}, })
+                                                      notEofOrType(CLOSE_CURLY_BRACKET, })
                                                       listener: endBlock(1, {, }, BlockKind(statement))
                                                 listener: endThenStatement({, })
                                                 listener: endIfStatement(if, null, })
-                                          notEofOrValue(}, })
+                                          notEofOrType(CLOSE_CURLY_BRACKET, })
                                           listener: endBlock(1, {, }, BlockKind(statement))
                                     listener: endThenStatement({, })
                                     listener: endIfStatement(if, null, })
-                              notEofOrValue(}, })
+                              notEofOrType(CLOSE_CURLY_BRACKET, })
                               listener: endBlock(1, {, }, BlockKind(statement))
                         listener: endThenStatement({, })
                         listener: endIfStatement(if, null, })
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(null, void, (, null, })
               listener: endMember()
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(void)
@@ -259,11 +259,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassMethod(null, void, (, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 2, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -290,7 +290,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Bar, DeclarationKind.Class, Bar)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Bar)
               parseMetadataStar({)
                 listener: beginMetadataStar(void)
@@ -317,11 +317,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassMethod(null, void, (, null, })
               listener: endMember()
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Bar)
               parseMetadataStar(})
                 listener: beginMetadataStar(void)
@@ -348,11 +348,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassMethod(null, void, (, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 2, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/with_outline/typing_06.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/with_outline/typing_06.dart.intertwined.expect
index 4583cc8..ce8470d 100644
--- a/pkg/front_end/parser_testcases/error_recovery/with_outline/typing_06.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/with_outline/typing_06.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Foo, DeclarationKind.Class, Foo)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Foo)
               parseMetadataStar({)
                 listener: beginMetadataStar(void)
@@ -52,7 +52,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, int)
+                  notEofOrType(CLOSE_CURLY_BRACKET, int)
                   parseStatement({)
                     parseStatementX({)
                       parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -80,7 +80,7 @@
                             listener: endInitializedIdentifier(i)
                           ensureSemicolon(0)
                           listener: endVariablesDeclaration(1, ;)
-                  notEofOrValue(}, while)
+                  notEofOrType(CLOSE_CURLY_BRACKET, while)
                   parseStatement(;)
                     parseStatementX(;)
                       parseWhileStatement(;)
@@ -93,7 +93,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(i, expression)
                                         listener: handleNoTypeArguments(<)
@@ -115,15 +114,15 @@
                             parseBlock(), BlockKind(statement))
                               ensureBlock(), BlockKind(statement))
                               listener: beginBlock({, BlockKind(statement))
-                              notEofOrValue(}, })
+                              notEofOrType(CLOSE_CURLY_BRACKET, })
                               listener: endBlock(0, {, }, BlockKind(statement))
                         listener: endWhileStatementBody(})
                         listener: endWhileStatement(while, })
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, void, (, null, })
               listener: endMember()
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(void)
@@ -150,11 +149,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassMethod(null, void, (, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 2, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -181,7 +180,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -208,7 +207,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/with_outline/typing_07.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/with_outline/typing_07.dart.intertwined.expect
index cc83789..7c74da4 100644
--- a/pkg/front_end/parser_testcases/error_recovery/with_outline/typing_07.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/with_outline/typing_07.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Foo, DeclarationKind.Class, Foo)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Foo)
               parseMetadataStar({)
                 listener: beginMetadataStar(void)
@@ -52,7 +52,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, for)
+                  notEofOrType(CLOSE_CURLY_BRACKET, for)
                   parseStatement({)
                     parseStatementX({)
                       parseForStatement({, null)
@@ -94,7 +94,6 @@
                                     parsePrimary(;, expression, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                                         parseSend(;, expression, ConstantPatternContext.none)
-                                          isNextIdentifier(;)
                                           ensureIdentifier(;, expression)
                                             listener: handleIdentifier(i, expression)
                                           listener: handleNoTypeArguments(<)
@@ -116,7 +115,6 @@
                                   parsePrimary(;, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                                       parseSend(;, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(;)
                                         ensureIdentifier(;, expression)
                                           listener: handleIdentifier(i, expression)
                                         listener: handleNoTypeArguments(++)
@@ -131,15 +129,15 @@
                               parseBlock(), BlockKind(statement))
                                 ensureBlock(), BlockKind(statement))
                                 listener: beginBlock({, BlockKind(statement))
-                                notEofOrValue(}, })
+                                notEofOrType(CLOSE_CURLY_BRACKET, })
                                 listener: endBlock(0, {, }, BlockKind(statement))
                           listener: endForStatementBody(})
                           listener: endForStatement(})
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(null, void, (, null, })
               listener: endMember()
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(void)
@@ -166,11 +164,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassMethod(null, void, (, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 2, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -197,7 +195,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -224,7 +222,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/with_outline/typing_08.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/with_outline/typing_08.dart.intertwined.expect
index b9e2249..82479ef 100644
--- a/pkg/front_end/parser_testcases/error_recovery/with_outline/typing_08.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/with_outline/typing_08.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Foo, DeclarationKind.Class, Foo)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Foo)
               parseMetadataStar({)
                 listener: beginMetadataStar(void)
@@ -64,7 +64,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, switch)
+                  notEofOrType(CLOSE_CURLY_BRACKET, switch)
                   parseStatement({)
                     parseStatementX({)
                       parseSwitchStatement({)
@@ -77,7 +77,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(input, expression)
                                         listener: handleNoTypeArguments())
@@ -89,14 +88,14 @@
                         parseSwitchBlock())
                           ensureBlock(), BlockKind(switch statement))
                           listener: beginSwitchBlock({)
-                          notEofOrValue(}, })
+                          notEofOrType(CLOSE_CURLY_BRACKET, })
                           listener: endSwitchBlock(0, {, })
                         listener: endSwitchStatement(switch, })
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(null, void, (, null, })
               listener: endMember()
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(void)
@@ -123,11 +122,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassMethod(null, void, (, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 2, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -154,7 +153,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -181,7 +180,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/with_outline/typing_09.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/with_outline/typing_09.dart.intertwined.expect
index ab734e6..57e7bbd 100644
--- a/pkg/front_end/parser_testcases/error_recovery/with_outline/typing_09.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/with_outline/typing_09.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Foo, DeclarationKind.Class, Foo)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Foo)
               parseMetadataStar({)
                 listener: beginMetadataStar(void)
@@ -64,7 +64,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -99,7 +99,7 @@
                             parseBlock(), BlockKind(statement))
                               ensureBlock(), BlockKind(statement))
                               listener: beginBlock({, BlockKind(statement))
-                              notEofOrValue(}, print)
+                              notEofOrType(CLOSE_CURLY_BRACKET, print)
                               parseStatement({)
                                 parseStatementX({)
                                   parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -112,7 +112,6 @@
                                               parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                                                 looksLikeFunctionBody(;)
                                                 parseSend({, expression, ConstantPatternContext.none)
-                                                  isNextIdentifier({)
                                                   ensureIdentifier({, expression)
                                                     listener: handleIdentifier(print, expression)
                                                   listener: handleNoTypeArguments(()
@@ -132,7 +131,7 @@
                                                   listener: handleSend(print, ))
                                       ensureSemicolon())
                                       listener: handleExpressionStatement(print, ;)
-                              notEofOrValue(}, })
+                              notEofOrType(CLOSE_CURLY_BRACKET, })
                               listener: endBlock(1, {, }, BlockKind(statement))
                         listener: endThenStatement({, })
                         listener: beginElseStatement(else)
@@ -141,15 +140,15 @@
                             parseBlock(else, BlockKind(statement))
                               ensureBlock(else, BlockKind(statement))
                               listener: beginBlock({, BlockKind(statement))
-                              notEofOrValue(}, })
+                              notEofOrType(CLOSE_CURLY_BRACKET, })
                               listener: endBlock(0, {, }, BlockKind(statement))
                         listener: endElseStatement(else, })
                         listener: endIfStatement(if, else, })
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(null, void, (, null, })
               listener: endMember()
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(void)
@@ -176,11 +175,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassMethod(null, void, (, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 2, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -207,7 +206,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -234,7 +233,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/with_outline/typing_10.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/with_outline/typing_10.dart.intertwined.expect
index 93bd3ab..022e9da 100644
--- a/pkg/front_end/parser_testcases/error_recovery/with_outline/typing_10.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/with_outline/typing_10.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Foo, DeclarationKind.Class, Foo)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Foo)
               parseMetadataStar({)
                 listener: beginMetadataStar(void)
@@ -64,7 +64,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -99,7 +99,7 @@
                             parseBlock(), BlockKind(statement))
                               ensureBlock(), BlockKind(statement))
                               listener: beginBlock({, BlockKind(statement))
-                              notEofOrValue(}, print)
+                              notEofOrType(CLOSE_CURLY_BRACKET, print)
                               parseStatement({)
                                 parseStatementX({)
                                   parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -112,7 +112,6 @@
                                               parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                                                 looksLikeFunctionBody(;)
                                                 parseSend({, expression, ConstantPatternContext.none)
-                                                  isNextIdentifier({)
                                                   ensureIdentifier({, expression)
                                                     listener: handleIdentifier(print, expression)
                                                   listener: handleNoTypeArguments(()
@@ -132,7 +131,7 @@
                                                   listener: handleSend(print, ))
                                       ensureSemicolon())
                                       listener: handleExpressionStatement(print, ;)
-                              notEofOrValue(}, })
+                              notEofOrType(CLOSE_CURLY_BRACKET, })
                               listener: endBlock(1, {, }, BlockKind(statement))
                         listener: endThenStatement({, })
                         listener: beginElseStatement(else)
@@ -170,17 +169,17 @@
                                   parseBlock(), BlockKind(statement))
                                     ensureBlock(), BlockKind(statement))
                                     listener: beginBlock({, BlockKind(statement))
-                                    notEofOrValue(}, })
+                                    notEofOrType(CLOSE_CURLY_BRACKET, })
                                     listener: endBlock(0, {, }, BlockKind(statement))
                               listener: endThenStatement({, })
                               listener: endIfStatement(if, null, })
                         listener: endElseStatement(else, })
                         listener: endIfStatement(if, else, })
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(null, void, (, null, })
               listener: endMember()
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(void)
@@ -207,11 +206,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassMethod(null, void, (, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 2, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -238,7 +237,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -265,7 +264,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/with_outline/typing_11.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/with_outline/typing_11.dart.intertwined.expect
index 6b6907d..c9bb4c6 100644
--- a/pkg/front_end/parser_testcases/error_recovery/with_outline/typing_11.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/with_outline/typing_11.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Foo, DeclarationKind.Class, Foo)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Foo)
               parseMetadataStar({)
                 listener: beginMetadataStar(void)
@@ -64,7 +64,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, try)
+                  notEofOrType(CLOSE_CURLY_BRACKET, try)
                   parseStatement({)
                     parseStatementX({)
                       parseTryStatement({)
@@ -72,16 +72,16 @@
                         parseBlock(try, BlockKind(try statement))
                           ensureBlock(try, BlockKind(try statement))
                           listener: beginBlock({, BlockKind(try statement))
-                          notEofOrValue(}, })
+                          notEofOrType(CLOSE_CURLY_BRACKET, })
                           listener: endBlock(0, {, }, BlockKind(try statement))
                         reportRecoverableError(try, OnlyTry)
                           listener: handleRecoverableError(OnlyTry, try, try)
                         listener: endTryStatement(0, try, null, })
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(null, void, (, null, })
               listener: endMember()
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(void)
@@ -108,11 +108,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassMethod(null, void, (, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 2, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -139,7 +139,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -166,7 +166,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/with_outline/typing_12.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/with_outline/typing_12.dart.intertwined.expect
index f51a8d0..157f109 100644
--- a/pkg/front_end/parser_testcases/error_recovery/with_outline/typing_12.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/with_outline/typing_12.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Foo, DeclarationKind.Class, Foo)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Foo)
               parseMetadataStar({)
                 listener: beginMetadataStar(void)
@@ -64,7 +64,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, try)
+                  notEofOrType(CLOSE_CURLY_BRACKET, try)
                   parseStatement({)
                     parseStatementX({)
                       parseTryStatement({)
@@ -72,7 +72,7 @@
                         parseBlock(try, BlockKind(try statement))
                           ensureBlock(try, BlockKind(try statement))
                           listener: beginBlock({, BlockKind(try statement))
-                          notEofOrValue(}, })
+                          notEofOrType(CLOSE_CURLY_BRACKET, })
                           listener: endBlock(0, {, }, BlockKind(try statement))
                         listener: beginCatchClause(catch)
                         parseFormalParameters(catch, MemberKind.Catch)
@@ -93,15 +93,15 @@
                         parseBlock(), BlockKind(catch clause))
                           ensureBlock(), BlockKind(catch clause))
                           listener: beginBlock({, BlockKind(catch clause))
-                          notEofOrValue(}, })
+                          notEofOrType(CLOSE_CURLY_BRACKET, })
                           listener: endBlock(0, {, }, BlockKind(catch clause))
                         listener: handleCatchBlock(null, catch, null)
                         listener: endTryStatement(1, try, null, })
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(null, void, (, null, })
               listener: endMember()
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(void)
@@ -128,11 +128,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassMethod(null, void, (, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 2, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -159,7 +159,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -186,7 +186,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/with_outline/typing_13.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/with_outline/typing_13.dart.intertwined.expect
index ce87084..2e7d05f 100644
--- a/pkg/front_end/parser_testcases/error_recovery/with_outline/typing_13.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/with_outline/typing_13.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Foo, DeclarationKind.Class, Foo)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Foo)
               parseMetadataStar({)
                 listener: beginMetadataStar(void)
@@ -64,7 +64,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, try)
+                  notEofOrType(CLOSE_CURLY_BRACKET, try)
                   parseStatement({)
                     parseStatementX({)
                       parseTryStatement({)
@@ -72,7 +72,7 @@
                         parseBlock(try, BlockKind(try statement))
                           ensureBlock(try, BlockKind(try statement))
                           listener: beginBlock({, BlockKind(try statement))
-                          notEofOrValue(}, })
+                          notEofOrType(CLOSE_CURLY_BRACKET, })
                           listener: endBlock(0, {, }, BlockKind(try statement))
                         listener: beginCatchClause(catch)
                         parseFormalParameters(catch, MemberKind.Catch)
@@ -93,21 +93,21 @@
                         parseBlock(), BlockKind(catch clause))
                           ensureBlock(), BlockKind(catch clause))
                           listener: beginBlock({, BlockKind(catch clause))
-                          notEofOrValue(}, })
+                          notEofOrType(CLOSE_CURLY_BRACKET, })
                           listener: endBlock(0, {, }, BlockKind(catch clause))
                         listener: handleCatchBlock(null, catch, null)
                         parseBlock(finally, BlockKind(finally clause))
                           ensureBlock(finally, BlockKind(finally clause))
                           listener: beginBlock({, BlockKind(finally clause))
-                          notEofOrValue(}, })
+                          notEofOrType(CLOSE_CURLY_BRACKET, })
                           listener: endBlock(0, {, }, BlockKind(finally clause))
                         listener: handleFinallyBlock(finally)
                         listener: endTryStatement(1, try, finally, })
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(null, void, (, null, })
               listener: endMember()
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(void)
@@ -134,11 +134,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassMethod(null, void, (, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 2, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -165,7 +165,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -192,7 +192,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/with_outline/typing_14.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/with_outline/typing_14.dart.intertwined.expect
index ab558dd..5f4a169 100644
--- a/pkg/front_end/parser_testcases/error_recovery/with_outline/typing_14.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/with_outline/typing_14.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Foo, DeclarationKind.Class, Foo)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Foo)
               parseMetadataStar({)
                 listener: beginMetadataStar(void)
@@ -64,7 +64,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -99,7 +99,7 @@
                             parseBlock(), BlockKind(statement))
                               ensureBlock(), BlockKind(statement))
                               listener: beginBlock({, BlockKind(statement))
-                              notEofOrValue(}, foo_method2)
+                              notEofOrType(CLOSE_CURLY_BRACKET, foo_method2)
                               parseStatement({)
                                 parseStatementX({)
                                   parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -112,7 +112,6 @@
                                               parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                                                 looksLikeFunctionBody(})
                                                 parseSend({, expression, ConstantPatternContext.none)
-                                                  isNextIdentifier({)
                                                   ensureIdentifier({, expression)
                                                     listener: handleIdentifier(foo_method2, expression)
                                                   listener: handleNoTypeArguments(()
@@ -152,15 +151,15 @@
                                           listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], ), ))
                                         rewriter()
                                       listener: handleExpressionStatement(foo_method2, ;)
-                              notEofOrValue(}, })
+                              notEofOrType(CLOSE_CURLY_BRACKET, })
                               listener: endBlock(1, {, }, BlockKind(statement))
                         listener: endThenStatement({, })
                         listener: endIfStatement(if, null, })
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(null, void, (, null, })
               listener: endMember()
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(void)
@@ -199,11 +198,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassMethod(null, void, (, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 2, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -230,7 +229,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -257,7 +256,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/with_outline/typing_15.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/with_outline/typing_15.dart.intertwined.expect
index 6643676..a7d094b 100644
--- a/pkg/front_end/parser_testcases/error_recovery/with_outline/typing_15.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/with_outline/typing_15.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Foo, DeclarationKind.Class, Foo)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Foo)
               parseMetadataStar({)
                 listener: beginMetadataStar(void)
@@ -64,7 +64,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -99,15 +99,15 @@
                             parseBlock(), BlockKind(statement))
                               ensureBlock(), BlockKind(statement))
                               listener: beginBlock({, BlockKind(statement))
-                              notEofOrValue(}, })
+                              notEofOrType(CLOSE_CURLY_BRACKET, })
                               listener: endBlock(0, {, }, BlockKind(statement))
                         listener: endThenStatement({, })
                         listener: endIfStatement(if, null, })
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(null, void, (, null, })
               listener: endMember()
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(void)
@@ -134,7 +134,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -274,15 +274,15 @@
                             parseBlock(), BlockKind(statement))
                               ensureBlock(), BlockKind(statement))
                               listener: beginBlock({, BlockKind(statement))
-                              notEofOrValue(}, })
+                              notEofOrType(CLOSE_CURLY_BRACKET, })
                               listener: endBlock(0, {, }, BlockKind(statement))
                         listener: endThenStatement({, })
                         listener: endIfStatement(if, null, })
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(null, void, (, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 2, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -309,7 +309,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -336,7 +336,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/error_recovery/yield_not_in_generator.dart.intertwined.expect b/pkg/front_end/parser_testcases/error_recovery/yield_not_in_generator.dart.intertwined.expect
index a997f4e..8267a20 100644
--- a/pkg/front_end/parser_testcases/error_recovery/yield_not_in_generator.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/error_recovery/yield_not_in_generator.dart.intertwined.expect
@@ -37,7 +37,6 @@
                   parsePrimary(=>, expression, ConstantPatternContext.none)
                     parseSendOrFunctionLiteral(=>, expression, ConstantPatternContext.none)
                       parseSend(=>, expression, ConstantPatternContext.none)
-                        isNextIdentifier(=>)
                         ensureIdentifier(=>, expression)
                           listener: handleIdentifier(Future, expression)
                         listener: handleNoTypeArguments(.)
@@ -47,7 +46,6 @@
                 parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                   parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                     parseSend(., expressionContinuation, ConstantPatternContext.none)
-                      isNextIdentifier(.)
                       ensureIdentifier(., expressionContinuation)
                         listener: handleIdentifier(value, expressionContinuation)
                       listener: handleNoTypeArguments(()
@@ -98,7 +96,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, yield)
+          notEofOrType(CLOSE_CURLY_BRACKET, yield)
           parseStatement({)
             parseStatementX({)
               looksLikeYieldStatement({, AwaitOrYieldContext.Statement)
@@ -112,7 +110,6 @@
                         parseSendOrFunctionLiteral(yield, expression, ConstantPatternContext.none)
                           looksLikeFunctionBody(;)
                           parseSend(yield, expression, ConstantPatternContext.none)
-                            isNextIdentifier(yield)
                             ensureIdentifier(yield, expression)
                               listener: handleIdentifier(f, expression)
                             listener: handleNoTypeArguments(()
@@ -127,7 +124,7 @@
                 reportRecoverableError(yield, YieldNotGenerator)
                   listener: handleRecoverableError(YieldNotGenerator, yield, yield)
                 listener: endInvalidYieldStatement(yield, null, ;, YieldNotGenerator)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(List, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/extension_named_type.dart.intertwined.expect b/pkg/front_end/parser_testcases/extension_named_type.dart.intertwined.expect
index 4fd8899..97e24bb 100644
--- a/pkg/front_end/parser_testcases/extension_named_type.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/extension_named_type.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(A, DeclarationKind.Class, A)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -61,7 +61,7 @@
           ensureBlock(A, BlockKind(extension type declaration))
           parseClassOrMixinOrExtensionBody(A, DeclarationKind.ExtensionType, on)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, method)
+            notEofOrType(CLOSE_CURLY_BRACKET, method)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.ExtensionType, on)
               parseMetadataStar({)
                 listener: beginMetadataStar(method)
@@ -89,11 +89,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endExtensionTypeMethod(null, method, (, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 1, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
@@ -140,7 +140,6 @@
                     parseSendOrFunctionLiteral(=>, expression, ConstantPatternContext.none)
                       looksLikeFunctionBody(.)
                       parseSend(=>, expression, ConstantPatternContext.none)
-                        isNextIdentifier(=>)
                         ensureIdentifier(=>, expression)
                           listener: handleIdentifier(type, expression)
                         listener: handleNoTypeArguments(()
@@ -153,7 +152,6 @@
                                   parseUnaryExpression((, true, ConstantPatternContext.none)
                                     parsePrimary((, expression, ConstantPatternContext.none)
                                       parseNewExpression(()
-                                        isNextIdentifier(new)
                                         listener: beginNewExpression(new)
                                         parseConstructorReference(new, ConstructorReferenceContext.New, null)
                                           ensureIdentifier(new, constructorReference)
@@ -173,7 +171,6 @@
                 parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                   parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                     parseSend(., expressionContinuation, ConstantPatternContext.none)
-                      isNextIdentifier(.)
                       ensureIdentifier(., expressionContinuation)
                         listener: handleIdentifier(method, expressionContinuation)
                       listener: handleNoTypeArguments(()
diff --git a/pkg/front_end/parser_testcases/extension_type.dart.intertwined.expect b/pkg/front_end/parser_testcases/extension_type.dart.intertwined.expect
index 2c29504..08be7a2 100644
--- a/pkg/front_end/parser_testcases/extension_type.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/extension_type.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(A, DeclarationKind.Class, A)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -65,7 +65,7 @@
           ensureBlock(A, BlockKind(extension type declaration))
           parseClassOrMixinOrExtensionBody(A, DeclarationKind.ExtensionType, E)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 0, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/extensions/const.dart.intertwined.expect b/pkg/front_end/parser_testcases/extensions/const.dart.intertwined.expect
index 9b5b40a7..888db8d 100644
--- a/pkg/front_end/parser_testcases/extensions/const.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/extensions/const.dart.intertwined.expect
@@ -29,7 +29,7 @@
               rewriter()
           parseClassOrMixinOrExtensionBody(, DeclarationKind.Extension, null)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Extension, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Extension, 0, {, })
           listener: endExtensionDeclaration(extension, extension, on, })
   listener: endTopLevelDeclaration(})
@@ -85,7 +85,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/extensions/covariant.dart.intertwined.expect b/pkg/front_end/parser_testcases/extensions/covariant.dart.intertwined.expect
index 95a8fc4..b41d7d8 100644
--- a/pkg/front_end/parser_testcases/extensions/covariant.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/extensions/covariant.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(A, DeclarationKind.Class, A)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -55,7 +55,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(A, DeclarationKind.Class, C)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -74,7 +74,7 @@
           listener: handleType(C, null)
           parseClassOrMixinOrExtensionBody(C, DeclarationKind.Extension, null)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Extension, {)
-            notEofOrValue(}, addChild)
+            notEofOrType(CLOSE_CURLY_BRACKET, addChild)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Extension, null)
               parseMetadataStar({)
                 listener: beginMetadataStar(addChild)
@@ -116,11 +116,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endExtensionMethod(null, addChild, (, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Extension, 1, {, })
           listener: endExtensionDeclaration(extension, extension, on, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/extensions/not_covariant.dart.intertwined.expect b/pkg/front_end/parser_testcases/extensions/not_covariant.dart.intertwined.expect
index 0339d7d..153ab6f 100644
--- a/pkg/front_end/parser_testcases/extensions/not_covariant.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/extensions/not_covariant.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(A, DeclarationKind.Class, A)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -55,7 +55,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(A, DeclarationKind.Class, C)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -74,7 +74,7 @@
           listener: handleType(C, null)
           parseClassOrMixinOrExtensionBody(C, DeclarationKind.Extension, null)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Extension, {)
-            notEofOrValue(}, addChild)
+            notEofOrType(CLOSE_CURLY_BRACKET, addChild)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Extension, null)
               parseMetadataStar({)
                 listener: beginMetadataStar(addChild)
@@ -114,11 +114,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endExtensionMethod(null, addChild, (, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Extension, 1, {, })
           listener: endExtensionDeclaration(extension, extension, on, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/extensions/static.dart.intertwined.expect b/pkg/front_end/parser_testcases/extensions/static.dart.intertwined.expect
index f64620c..9d9e99c 100644
--- a/pkg/front_end/parser_testcases/extensions/static.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/extensions/static.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(A, DeclarationKind.Class, A)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -55,7 +55,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(A, DeclarationKind.Class, C)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -74,7 +74,7 @@
           listener: handleType(C, null)
           parseClassOrMixinOrExtensionBody(C, DeclarationKind.Extension, null)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Extension, {)
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Extension, null)
               parseMetadataStar({)
                 listener: beginMetadataStar(static)
@@ -113,11 +113,11 @@
                   inPlainSync()
                 parseFunctionBody(), false, false)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endExtensionMethod(null, static, (, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Extension, 1, {, })
           listener: endExtensionDeclaration(extension, extension, on, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/extensions/static_covariant.dart.intertwined.expect b/pkg/front_end/parser_testcases/extensions/static_covariant.dart.intertwined.expect
index 7fb311f9..e8a26d2 100644
--- a/pkg/front_end/parser_testcases/extensions/static_covariant.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/extensions/static_covariant.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(A, DeclarationKind.Class, A)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -55,7 +55,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(A, DeclarationKind.Class, C)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -74,7 +74,7 @@
           listener: handleType(C, null)
           parseClassOrMixinOrExtensionBody(C, DeclarationKind.Extension, null)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Extension, {)
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Extension, null)
               parseMetadataStar({)
                 listener: beginMetadataStar(static)
@@ -115,11 +115,11 @@
                   inPlainSync()
                 parseFunctionBody(), false, false)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endExtensionMethod(null, static, (, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Extension, 1, {, })
           listener: endExtensionDeclaration(extension, extension, on, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/general/ambiguous_builder_01.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/ambiguous_builder_01.dart.intertwined.expect
index 803fcdb..bc15f7f 100644
--- a/pkg/front_end/parser_testcases/general/ambiguous_builder_01.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/ambiguous_builder_01.dart.intertwined.expect
@@ -165,7 +165,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -178,7 +178,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(!=)
@@ -200,11 +199,11 @@
                     parseBlock(), BlockKind(statement))
                       ensureBlock(), BlockKind(statement))
                       listener: beginBlock({, BlockKind(statement))
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlock(0, {, }, BlockKind(statement))
                 listener: endThenStatement({, })
                 listener: endIfStatement(if, null, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/general/assignment.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/assignment.dart.intertwined.expect
index 1ea31d9..ede33db 100644
--- a/pkg/front_end/parser_testcases/general/assignment.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/assignment.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, foo)
+          notEofOrType(CLOSE_CURLY_BRACKET, foo)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -38,7 +38,6 @@
                         parsePrimary({, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(foo, expression)
                               listener: handleNoTypeArguments(=)
@@ -53,7 +52,7 @@
                       listener: handleAssignmentExpression(=, 42)
                   ensureSemicolon(42)
                   listener: handleExpressionStatement(foo, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/general/augment_super.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/augment_super.dart.intertwined.expect
index d598ec2..07fb298 100644
--- a/pkg/front_end/parser_testcases/general/augment_super.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/augment_super.dart.intertwined.expect
@@ -48,7 +48,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, augment)
+          notEofOrType(CLOSE_CURLY_BRACKET, augment)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -74,7 +74,7 @@
                       listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], super, super)
                     rewriter()
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -92,7 +92,7 @@
                                 listener: endRecordLiteral((, 0, null)
                     ensureSemicolon())
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -142,7 +142,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, augment)
+          notEofOrType(CLOSE_CURLY_BRACKET, augment)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -166,7 +166,7 @@
                       listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], int, int)
                     rewriter()
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, local)
+          notEofOrType(CLOSE_CURLY_BRACKET, local)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -178,7 +178,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(local, expression)
                               listener: handleNoTypeArguments(;)
@@ -187,7 +186,7 @@
                               listener: handleSend(local, local)
                   ensureSemicolon(local)
                   listener: handleExpressionStatement(local, ;)
-          notEofOrValue(}, augment)
+          notEofOrType(CLOSE_CURLY_BRACKET, augment)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -199,7 +198,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(augment, expression)
                               listener: handleNoTypeArguments(;)
@@ -208,7 +206,7 @@
                               listener: handleSend(augment, augment)
                   ensureSemicolon(augment)
                   listener: handleExpressionStatement(augment, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(3, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -277,7 +275,7 @@
         inPlainSync()
         parseFunctionBody(topLevelProperty, false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement({)
             parseStatementX({)
               parseReturnStatement({)
@@ -294,7 +292,6 @@
                                 parsePrimary(..., expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(..., expression, ConstantPatternContext.none)
                                     parseSend(..., expression, ConstantPatternContext.none)
-                                      isNextIdentifier(...)
                                       ensureIdentifier(..., expression)
                                         listener: handleIdentifier(augment, expression)
                                       listener: handleNoTypeArguments(super)
@@ -318,7 +315,6 @@
                                 parsePrimary(,, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                     parseSend(,, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(,)
                                       ensureIdentifier(,, expression)
                                         listener: handleIdentifier(augment, expression)
                                       listener: handleNoTypeArguments(super)
@@ -347,7 +343,7 @@
                 ensureSemicolon(])
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(get, get, })
   listener: endTopLevelDeclaration(})
@@ -413,7 +409,7 @@
         inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, augment)
+          notEofOrType(CLOSE_CURLY_BRACKET, augment)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -439,7 +435,7 @@
                       listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], super, super)
                     rewriter()
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, [)
+          notEofOrType(CLOSE_CURLY_BRACKET, [)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -464,7 +460,6 @@
                             parsePrimary(=, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                 parseSend(=, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(=)
                                   ensureIdentifier(=, expression)
                                     listener: handleIdentifier(value, expression)
                                   listener: handleNoTypeArguments([)
@@ -482,7 +477,7 @@
                         listener: handleAssignmentExpression(=, ])
                     ensureSemicolon(])
                     listener: handleExpressionStatement([, ;)
-          notEofOrValue(}, augment)
+          notEofOrType(CLOSE_CURLY_BRACKET, augment)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -508,7 +503,6 @@
                             parsePrimary(=, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                 parseSend(=, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(=)
                                   ensureIdentifier(=, expression)
                                     listener: handleIdentifier(value, expression)
                                   listener: handleNoTypeArguments(;)
@@ -519,7 +513,7 @@
                     listener: endInitializedIdentifier(super)
                   ensureSemicolon(value)
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(3, {, })
         listener: endTopLevelMethod(void, set, })
   listener: endTopLevelDeclaration(})
@@ -546,7 +540,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, augment)
+          notEofOrType(CLOSE_CURLY_BRACKET, augment)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -572,7 +566,7 @@
                       listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], super, super)
                     rewriter()
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -590,7 +584,7 @@
                                 listener: endRecordLiteral((, 0, null)
                     ensureSemicolon())
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, augment)
+          notEofOrType(CLOSE_CURLY_BRACKET, augment)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -613,7 +607,7 @@
                     listener: endInitializedIdentifier(super)
                   ensureSemicolon(super)
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, augment)
+          notEofOrType(CLOSE_CURLY_BRACKET, augment)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -637,7 +631,7 @@
                       listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], int, int)
                     rewriter()
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, local)
+          notEofOrType(CLOSE_CURLY_BRACKET, local)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -649,7 +643,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(local, expression)
                               listener: handleNoTypeArguments(;)
@@ -658,7 +651,7 @@
                               listener: handleSend(local, local)
                   ensureSemicolon(local)
                   listener: handleExpressionStatement(local, ;)
-          notEofOrValue(}, augment)
+          notEofOrType(CLOSE_CURLY_BRACKET, augment)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -670,7 +663,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(augment, expression)
                               listener: handleNoTypeArguments(;)
@@ -679,7 +671,7 @@
                               listener: handleSend(augment, augment)
                   ensureSemicolon(augment)
                   listener: handleExpressionStatement(augment, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(6, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -729,7 +721,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Class, DeclarationKind.Class, Class)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Class)
               parseMetadataStar({)
                 listener: beginMetadataStar(augment)
@@ -752,7 +744,7 @@
                   rewriter()
                 listener: endClassFields(null, null, null, null, null, null, null, 1, augment, ;)
               listener: endMember()
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(void)
@@ -779,7 +771,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, augment)
+                  notEofOrType(CLOSE_CURLY_BRACKET, augment)
                   parseStatement({)
                     parseStatementX({)
                       parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -805,7 +797,7 @@
                               listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], super, super)
                             rewriter()
                           listener: endVariablesDeclaration(1, ;)
-                  notEofOrValue(}, ()
+                  notEofOrType(CLOSE_CURLY_BRACKET, ()
                   parseStatement(;)
                     parseStatementX(;)
                       parseExpressionStatementOrDeclaration(;, null)
@@ -823,11 +815,11 @@
                                         listener: endRecordLiteral((, 0, null)
                             ensureSemicolon())
                             listener: handleExpressionStatement((, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, void, (, null, })
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Class)
               parseMetadataStar(})
                 listener: beginMetadataStar(augment)
@@ -850,7 +842,7 @@
                   rewriter()
                 listener: endClassFields(null, null, null, null, null, null, null, 1, augment, ;)
               listener: endMember()
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(void)
@@ -877,7 +869,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, augment)
+                  notEofOrType(CLOSE_CURLY_BRACKET, augment)
                   parseStatement({)
                     parseStatementX({)
                       parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -901,7 +893,7 @@
                               listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], int, int)
                             rewriter()
                           listener: endVariablesDeclaration(1, ;)
-                  notEofOrValue(}, local)
+                  notEofOrType(CLOSE_CURLY_BRACKET, local)
                   parseStatement(;)
                     parseStatementX(;)
                       parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -913,7 +905,6 @@
                                 parsePrimary(;, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                                     parseSend(;, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(;)
                                       ensureIdentifier(;, expression)
                                         listener: handleIdentifier(local, expression)
                                       listener: handleNoTypeArguments(;)
@@ -922,7 +913,7 @@
                                       listener: handleSend(local, local)
                           ensureSemicolon(local)
                           listener: handleExpressionStatement(local, ;)
-                  notEofOrValue(}, augment)
+                  notEofOrType(CLOSE_CURLY_BRACKET, augment)
                   parseStatement(;)
                     parseStatementX(;)
                       parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -934,7 +925,6 @@
                                 parsePrimary(;, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                                     parseSend(;, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(;)
                                       ensureIdentifier(;, expression)
                                         listener: handleIdentifier(augment, expression)
                                       listener: handleNoTypeArguments(;)
@@ -943,11 +933,11 @@
                                       listener: handleSend(augment, augment)
                           ensureSemicolon(augment)
                           listener: handleExpressionStatement(augment, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(3, {, })
                 listener: endClassMethod(null, void, (, null, })
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Class)
               parseMetadataStar(})
                 listener: beginMetadataStar(augment)
@@ -968,7 +958,7 @@
                   rewriter()
                 listener: endClassFields(null, null, null, null, null, null, null, 1, augment, ;)
               listener: endMember()
-            notEofOrValue(}, get)
+            notEofOrType(CLOSE_CURLY_BRACKET, get)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(get)
@@ -992,7 +982,7 @@
                 inPlainSync()
                 parseFunctionBody(instanceProperty, false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, augment)
+                  notEofOrType(CLOSE_CURLY_BRACKET, augment)
                   parseStatement({)
                     parseStatementX({)
                       parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -1018,7 +1008,7 @@
                               listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], super, super)
                             rewriter()
                           listener: endVariablesDeclaration(1, ;)
-                  notEofOrValue(}, ++)
+                  notEofOrType(CLOSE_CURLY_BRACKET, ++)
                   parseStatement(;)
                     parseStatementX(;)
                       parseExpressionStatementOrDeclaration(;, null)
@@ -1032,7 +1022,6 @@
                                     parseUnaryExpression(++, true, ConstantPatternContext.none)
                                       parsePrimary(++, expression, ConstantPatternContext.none)
                                         parseSend(++, expression, ConstantPatternContext.none)
-                                          isNextIdentifier(++)
                                           ensureIdentifier(++, expression)
                                             reportRecoverableErrorWithToken(;, Template(ExpectedIdentifier))
                                               listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got ';'., Try inserting an identifier before ';'., {lexeme: ;}], ;, ;)
@@ -1045,7 +1034,7 @@
                                   listener: handleUnaryPrefixAssignmentExpression(++)
                             ensureSemicolon()
                             listener: handleExpressionStatement(++, ;)
-                  notEofOrValue(}, --)
+                  notEofOrType(CLOSE_CURLY_BRACKET, --)
                   parseStatement(;)
                     parseStatementX(;)
                       parseExpressionStatementOrDeclaration(;, null)
@@ -1060,7 +1049,6 @@
                                       parsePrimary(--, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral(--, expression, ConstantPatternContext.none)
                                           parseSend(--, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(--)
                                             ensureIdentifier(--, expression)
                                               listener: handleIdentifier(augment, expression)
                                             listener: handleNoTypeArguments(super)
@@ -1073,7 +1061,7 @@
                                 listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], augment, augment)
                               rewriter()
                             listener: handleExpressionStatement(--, ;)
-                  notEofOrValue(}, super)
+                  notEofOrType(CLOSE_CURLY_BRACKET, super)
                   parseStatement(;)
                     parseStatementX(;)
                       parseExpressionStatementOrDeclaration(;, null)
@@ -1088,7 +1076,7 @@
                                       listener: handleSuperExpression(super, expression)
                             ensureSemicolon(super)
                             listener: handleExpressionStatement(super, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -1101,7 +1089,6 @@
                                   parsePrimary(-, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(-, expression, ConstantPatternContext.none)
                                       parseSend(-, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(-)
                                         ensureIdentifier(-, expression)
                                           listener: handleIdentifier(augment, expression)
                                         listener: handleNoTypeArguments(super)
@@ -1115,7 +1102,7 @@
                           rewriter()
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, super)
+                  notEofOrType(CLOSE_CURLY_BRACKET, super)
                   parseStatement(;)
                     parseStatementX(;)
                       parseExpressionStatementOrDeclaration(;, null)
@@ -1130,11 +1117,11 @@
                                       listener: handleSuperExpression(super, expression)
                             ensureSemicolon(super)
                             listener: handleExpressionStatement(super, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(6, {, })
                 listener: endClassMethod(get, get, {, null, })
               listener: endMember()
-            notEofOrValue(}, augment)
+            notEofOrType(CLOSE_CURLY_BRACKET, augment)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Class)
               parseMetadataStar(})
                 listener: beginMetadataStar(augment)
@@ -1157,7 +1144,7 @@
                   rewriter()
                 listener: endClassFields(null, null, null, null, null, null, null, 1, augment, ;)
               listener: endMember()
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(void)
@@ -1196,7 +1183,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, augment)
+                  notEofOrType(CLOSE_CURLY_BRACKET, augment)
                   parseStatement({)
                     parseStatementX({)
                       parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -1222,7 +1209,6 @@
                                     parsePrimary(=, expression, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                         parseSend(=, expression, ConstantPatternContext.none)
-                                          isNextIdentifier(=)
                                           ensureIdentifier(=, expression)
                                             listener: handleIdentifier(value, expression)
                                           listener: handleNoTypeArguments(;)
@@ -1233,11 +1219,11 @@
                             listener: endInitializedIdentifier(super)
                           ensureSemicolon(value)
                           listener: endVariablesDeclaration(1, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(set, void, (, null, })
               listener: endMember()
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Class)
               parseMetadataStar(})
                 listener: beginMetadataStar(void)
@@ -1264,7 +1250,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, augment)
+                  notEofOrType(CLOSE_CURLY_BRACKET, augment)
                   parseStatement({)
                     parseStatementX({)
                       parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -1290,7 +1276,7 @@
                               listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], super, super)
                             rewriter()
                           listener: endVariablesDeclaration(1, ;)
-                  notEofOrValue(}, ()
+                  notEofOrType(CLOSE_CURLY_BRACKET, ()
                   parseStatement(;)
                     parseStatementX(;)
                       parseExpressionStatementOrDeclaration(;, null)
@@ -1308,7 +1294,7 @@
                                         listener: endRecordLiteral((, 0, null)
                             ensureSemicolon())
                             listener: handleExpressionStatement((, ;)
-                  notEofOrValue(}, augment)
+                  notEofOrType(CLOSE_CURLY_BRACKET, augment)
                   parseStatement(;)
                     parseStatementX(;)
                       parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -1331,7 +1317,7 @@
                             listener: endInitializedIdentifier(super)
                           ensureSemicolon(super)
                           listener: endVariablesDeclaration(1, ;)
-                  notEofOrValue(}, augment)
+                  notEofOrType(CLOSE_CURLY_BRACKET, augment)
                   parseStatement(;)
                     parseStatementX(;)
                       parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -1355,7 +1341,7 @@
                               listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], int, int)
                             rewriter()
                           listener: endVariablesDeclaration(1, ;)
-                  notEofOrValue(}, local)
+                  notEofOrType(CLOSE_CURLY_BRACKET, local)
                   parseStatement(;)
                     parseStatementX(;)
                       parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -1367,7 +1353,6 @@
                                 parsePrimary(;, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                                     parseSend(;, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(;)
                                       ensureIdentifier(;, expression)
                                         listener: handleIdentifier(local, expression)
                                       listener: handleNoTypeArguments(;)
@@ -1376,7 +1361,7 @@
                                       listener: handleSend(local, local)
                           ensureSemicolon(local)
                           listener: handleExpressionStatement(local, ;)
-                  notEofOrValue(}, augment)
+                  notEofOrType(CLOSE_CURLY_BRACKET, augment)
                   parseStatement(;)
                     parseStatementX(;)
                       parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -1388,7 +1373,6 @@
                                 parsePrimary(;, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                                     parseSend(;, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(;)
                                       ensureIdentifier(;, expression)
                                         listener: handleIdentifier(augment, expression)
                                       listener: handleNoTypeArguments(;)
@@ -1397,11 +1381,11 @@
                                       listener: handleSend(augment, augment)
                           ensureSemicolon(augment)
                           listener: handleExpressionStatement(augment, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(6, {, })
                 listener: endClassMethod(null, void, (, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 9, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/general/built_in_identifier_class_fields.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/built_in_identifier_class_fields.dart.intertwined.expect
index 933b523..1a13c17 100644
--- a/pkg/front_end/parser_testcases/general/built_in_identifier_class_fields.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/built_in_identifier_class_fields.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(WrapperClass, DeclarationKind.Class, WrapperClass)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, WrapperClass)
               parseMetadataStar({)
                 listener: beginMetadataStar(int)
@@ -49,7 +49,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -73,7 +73,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -97,7 +97,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -121,7 +121,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -145,7 +145,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -169,7 +169,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -193,7 +193,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -217,7 +217,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -241,7 +241,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -266,7 +266,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -290,7 +290,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -314,7 +314,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -338,7 +338,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -362,7 +362,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -387,7 +387,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -411,7 +411,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -435,7 +435,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -460,7 +460,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -484,7 +484,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -508,7 +508,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 20, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/general/built_in_identifier_class_methods.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/built_in_identifier_class_methods.dart.intertwined.expect
index cce8138..d7f118e 100644
--- a/pkg/front_end/parser_testcases/general/built_in_identifier_class_methods.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/built_in_identifier_class_methods.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(WrapperClass, DeclarationKind.Class, WrapperClass)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, WrapperClass)
               parseMetadataStar({)
                 listener: beginMetadataStar(int)
@@ -66,7 +66,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -79,7 +79,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -111,7 +110,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -124,7 +123,6 @@
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody(;)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(abstract, expression)
@@ -139,7 +137,6 @@
                                                 parsePrimary((, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                     parseSend((, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(()
                                                       ensureIdentifier((, expression)
                                                         listener: handleIdentifier(x, expression)
                                                       listener: handleNoTypeArguments(-)
@@ -158,11 +155,11 @@
                         ensureSemicolon())
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -203,7 +200,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -216,7 +213,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -248,7 +244,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -261,7 +257,6 @@
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody(;)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(as, expression)
@@ -276,7 +271,6 @@
                                                 parsePrimary((, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                     parseSend((, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(()
                                                       ensureIdentifier((, expression)
                                                         listener: handleIdentifier(x, expression)
                                                       listener: handleNoTypeArguments(-)
@@ -295,11 +289,11 @@
                         ensureSemicolon())
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -340,7 +334,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -353,7 +347,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -385,7 +378,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -398,7 +391,6 @@
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody(;)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(covariant, expression)
@@ -413,7 +405,6 @@
                                                 parsePrimary((, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                     parseSend((, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(()
                                                       ensureIdentifier((, expression)
                                                         listener: handleIdentifier(x, expression)
                                                       listener: handleNoTypeArguments(-)
@@ -432,11 +423,11 @@
                         ensureSemicolon())
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -477,7 +468,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -490,7 +481,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -522,7 +512,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -535,7 +525,6 @@
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody(;)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(deferred, expression)
@@ -550,7 +539,6 @@
                                                 parsePrimary((, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                     parseSend((, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(()
                                                       ensureIdentifier((, expression)
                                                         listener: handleIdentifier(x, expression)
                                                       listener: handleNoTypeArguments(-)
@@ -569,11 +557,11 @@
                         ensureSemicolon())
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -614,7 +602,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -627,7 +615,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -659,7 +646,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -672,7 +659,6 @@
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody(;)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(dynamic, expression)
@@ -687,7 +673,6 @@
                                                 parsePrimary((, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                     parseSend((, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(()
                                                       ensureIdentifier((, expression)
                                                         listener: handleIdentifier(x, expression)
                                                       listener: handleNoTypeArguments(-)
@@ -706,11 +691,11 @@
                         ensureSemicolon())
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -751,7 +736,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -764,7 +749,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -796,7 +780,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -809,7 +793,6 @@
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody(;)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(export, expression)
@@ -824,7 +807,6 @@
                                                 parsePrimary((, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                     parseSend((, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(()
                                                       ensureIdentifier((, expression)
                                                         listener: handleIdentifier(x, expression)
                                                       listener: handleNoTypeArguments(-)
@@ -843,11 +825,11 @@
                         ensureSemicolon())
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -888,7 +870,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -901,7 +883,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -933,7 +914,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -946,7 +927,6 @@
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody(;)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(external, expression)
@@ -961,7 +941,6 @@
                                                 parsePrimary((, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                     parseSend((, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(()
                                                       ensureIdentifier((, expression)
                                                         listener: handleIdentifier(x, expression)
                                                       listener: handleNoTypeArguments(-)
@@ -980,11 +959,11 @@
                         ensureSemicolon())
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -1025,7 +1004,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -1038,7 +1017,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -1070,7 +1048,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -1083,7 +1061,6 @@
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody(;)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(factory, expression)
@@ -1098,7 +1075,6 @@
                                                 parsePrimary((, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                     parseSend((, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(()
                                                       ensureIdentifier((, expression)
                                                         listener: handleIdentifier(x, expression)
                                                       listener: handleNoTypeArguments(-)
@@ -1117,11 +1093,11 @@
                         ensureSemicolon())
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -1162,7 +1138,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -1175,7 +1151,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -1207,7 +1182,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -1220,7 +1195,6 @@
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody(;)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(Function, expression)
@@ -1235,7 +1209,6 @@
                                                 parsePrimary((, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                     parseSend((, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(()
                                                       ensureIdentifier((, expression)
                                                         listener: handleIdentifier(x, expression)
                                                       listener: handleNoTypeArguments(-)
@@ -1254,11 +1227,11 @@
                         ensureSemicolon())
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -1300,7 +1273,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -1313,7 +1286,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -1345,7 +1317,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -1358,7 +1330,6 @@
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody(;)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(get, expression)
@@ -1373,7 +1344,6 @@
                                                 parsePrimary((, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                     parseSend((, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(()
                                                       ensureIdentifier((, expression)
                                                         listener: handleIdentifier(x, expression)
                                                       listener: handleNoTypeArguments(-)
@@ -1392,11 +1362,11 @@
                         ensureSemicolon())
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -1437,7 +1407,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -1450,7 +1420,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -1482,7 +1451,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -1495,7 +1464,6 @@
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody(;)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(implements, expression)
@@ -1510,7 +1478,6 @@
                                                 parsePrimary((, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                     parseSend((, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(()
                                                       ensureIdentifier((, expression)
                                                         listener: handleIdentifier(x, expression)
                                                       listener: handleNoTypeArguments(-)
@@ -1529,11 +1496,11 @@
                         ensureSemicolon())
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -1574,7 +1541,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -1587,7 +1554,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -1619,7 +1585,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -1632,7 +1598,6 @@
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody(;)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(import, expression)
@@ -1647,7 +1612,6 @@
                                                 parsePrimary((, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                     parseSend((, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(()
                                                       ensureIdentifier((, expression)
                                                         listener: handleIdentifier(x, expression)
                                                       listener: handleNoTypeArguments(-)
@@ -1666,11 +1630,11 @@
                         ensureSemicolon())
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -1711,7 +1675,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -1724,7 +1688,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -1756,7 +1719,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -1769,7 +1732,6 @@
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody(;)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(interface, expression)
@@ -1784,7 +1746,6 @@
                                                 parsePrimary((, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                     parseSend((, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(()
                                                       ensureIdentifier((, expression)
                                                         listener: handleIdentifier(x, expression)
                                                       listener: handleNoTypeArguments(-)
@@ -1803,11 +1764,11 @@
                         ensureSemicolon())
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -1848,7 +1809,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -1861,7 +1822,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -1893,7 +1853,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -1906,7 +1866,6 @@
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody(;)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(library, expression)
@@ -1921,7 +1880,6 @@
                                                 parsePrimary((, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                     parseSend((, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(()
                                                       ensureIdentifier((, expression)
                                                         listener: handleIdentifier(x, expression)
                                                       listener: handleNoTypeArguments(-)
@@ -1940,11 +1898,11 @@
                         ensureSemicolon())
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -1987,7 +1945,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -2000,7 +1958,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -2032,7 +1989,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -2045,7 +2002,6 @@
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody(;)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(operator, expression)
@@ -2060,7 +2016,6 @@
                                                 parsePrimary((, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                     parseSend((, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(()
                                                       ensureIdentifier((, expression)
                                                         listener: handleIdentifier(x, expression)
                                                       listener: handleNoTypeArguments(-)
@@ -2079,11 +2034,11 @@
                         ensureSemicolon())
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -2124,7 +2079,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -2137,7 +2092,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -2169,7 +2123,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -2182,7 +2136,6 @@
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody(;)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(mixin, expression)
@@ -2197,7 +2150,6 @@
                                                 parsePrimary((, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                     parseSend((, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(()
                                                       ensureIdentifier((, expression)
                                                         listener: handleIdentifier(x, expression)
                                                       listener: handleNoTypeArguments(-)
@@ -2216,11 +2168,11 @@
                         ensureSemicolon())
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -2261,7 +2213,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -2274,7 +2226,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -2306,7 +2257,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -2319,7 +2270,6 @@
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody(;)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(part, expression)
@@ -2334,7 +2284,6 @@
                                                 parsePrimary((, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                     parseSend((, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(()
                                                       ensureIdentifier((, expression)
                                                         listener: handleIdentifier(x, expression)
                                                       listener: handleNoTypeArguments(-)
@@ -2353,11 +2302,11 @@
                         ensureSemicolon())
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -2399,7 +2348,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -2412,7 +2361,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -2444,7 +2392,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -2457,7 +2405,6 @@
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody(;)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(set, expression)
@@ -2472,7 +2419,6 @@
                                                 parsePrimary((, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                     parseSend((, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(()
                                                       ensureIdentifier((, expression)
                                                         listener: handleIdentifier(x, expression)
                                                       listener: handleNoTypeArguments(-)
@@ -2491,11 +2437,11 @@
                         ensureSemicolon())
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -2536,7 +2482,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -2549,7 +2495,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -2581,7 +2526,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -2594,7 +2539,6 @@
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody(;)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(static, expression)
@@ -2609,7 +2553,6 @@
                                                 parsePrimary((, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                     parseSend((, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(()
                                                       ensureIdentifier((, expression)
                                                         listener: handleIdentifier(x, expression)
                                                       listener: handleNoTypeArguments(-)
@@ -2628,11 +2571,11 @@
                         ensureSemicolon())
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, WrapperClass)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -2673,7 +2616,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -2686,7 +2629,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(==)
@@ -2718,7 +2660,7 @@
                               inGenerator()
                         listener: endThenStatement(return, ;)
                         listener: endIfStatement(if, null, ;)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement(;)
                     parseStatementX(;)
                       parseReturnStatement(;)
@@ -2731,7 +2673,6 @@
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   looksLikeFunctionBody(;)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(typedef, expression)
@@ -2746,7 +2687,6 @@
                                                 parsePrimary((, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                     parseSend((, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(()
                                                       ensureIdentifier((, expression)
                                                         listener: handleIdentifier(x, expression)
                                                       listener: handleNoTypeArguments(-)
@@ -2765,11 +2705,11 @@
                         ensureSemicolon())
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(2, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 20, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/general/built_in_identifier_top_level_methods.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/built_in_identifier_top_level_methods.dart.intertwined.expect
index 77470ef..12c318c 100644
--- a/pkg/front_end/parser_testcases/general/built_in_identifier_top_level_methods.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/built_in_identifier_top_level_methods.dart.intertwined.expect
@@ -39,7 +39,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -52,7 +52,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -84,7 +83,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -97,7 +96,6 @@
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           looksLikeFunctionBody(;)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               inPlainSync()
                               listener: handleIdentifier(abstract, expression)
@@ -112,7 +110,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(x, expression)
                                               listener: handleNoTypeArguments(-)
@@ -131,7 +128,7 @@
                 ensureSemicolon())
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -172,7 +169,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -185,7 +182,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -217,7 +213,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -230,7 +226,6 @@
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           looksLikeFunctionBody(;)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               inPlainSync()
                               listener: handleIdentifier(as, expression)
@@ -245,7 +240,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(x, expression)
                                               listener: handleNoTypeArguments(-)
@@ -264,7 +258,7 @@
                 ensureSemicolon())
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -305,7 +299,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -318,7 +312,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -350,7 +343,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -363,7 +356,6 @@
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           looksLikeFunctionBody(;)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               inPlainSync()
                               listener: handleIdentifier(covariant, expression)
@@ -378,7 +370,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(x, expression)
                                               listener: handleNoTypeArguments(-)
@@ -397,7 +388,7 @@
                 ensureSemicolon())
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -438,7 +429,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -451,7 +442,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -483,7 +473,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -496,7 +486,6 @@
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           looksLikeFunctionBody(;)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               inPlainSync()
                               listener: handleIdentifier(deferred, expression)
@@ -511,7 +500,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(x, expression)
                                               listener: handleNoTypeArguments(-)
@@ -530,7 +518,7 @@
                 ensureSemicolon())
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -571,7 +559,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -584,7 +572,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -616,7 +603,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -629,7 +616,6 @@
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           looksLikeFunctionBody(;)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               inPlainSync()
                               listener: handleIdentifier(dynamic, expression)
@@ -644,7 +630,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(x, expression)
                                               listener: handleNoTypeArguments(-)
@@ -663,7 +648,7 @@
                 ensureSemicolon())
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -704,7 +689,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -717,7 +702,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -749,7 +733,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -762,7 +746,6 @@
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           looksLikeFunctionBody(;)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               inPlainSync()
                               listener: handleIdentifier(export, expression)
@@ -777,7 +760,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(x, expression)
                                               listener: handleNoTypeArguments(-)
@@ -796,7 +778,7 @@
                 ensureSemicolon())
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -837,7 +819,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -850,7 +832,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -882,7 +863,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -895,7 +876,6 @@
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           looksLikeFunctionBody(;)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               inPlainSync()
                               listener: handleIdentifier(external, expression)
@@ -910,7 +890,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(x, expression)
                                               listener: handleNoTypeArguments(-)
@@ -929,7 +908,7 @@
                 ensureSemicolon())
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -970,7 +949,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -983,7 +962,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -1015,7 +993,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -1028,7 +1006,6 @@
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           looksLikeFunctionBody(;)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               inPlainSync()
                               listener: handleIdentifier(factory, expression)
@@ -1043,7 +1020,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(x, expression)
                                               listener: handleNoTypeArguments(-)
@@ -1062,7 +1038,7 @@
                 ensureSemicolon())
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -1103,7 +1079,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -1116,7 +1092,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -1148,7 +1123,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -1161,7 +1136,6 @@
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           looksLikeFunctionBody(;)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               inPlainSync()
                               listener: handleIdentifier(Function, expression)
@@ -1176,7 +1150,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(x, expression)
                                               listener: handleNoTypeArguments(-)
@@ -1195,7 +1168,7 @@
                 ensureSemicolon())
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -1236,7 +1209,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -1249,7 +1222,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -1281,7 +1253,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -1294,7 +1266,6 @@
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           looksLikeFunctionBody(;)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               inPlainSync()
                               listener: handleIdentifier(get, expression)
@@ -1309,7 +1280,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(x, expression)
                                               listener: handleNoTypeArguments(-)
@@ -1328,7 +1298,7 @@
                 ensureSemicolon())
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -1369,7 +1339,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -1382,7 +1352,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -1414,7 +1383,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -1427,7 +1396,6 @@
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           looksLikeFunctionBody(;)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               inPlainSync()
                               listener: handleIdentifier(implements, expression)
@@ -1442,7 +1410,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(x, expression)
                                               listener: handleNoTypeArguments(-)
@@ -1461,7 +1428,7 @@
                 ensureSemicolon())
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -1502,7 +1469,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -1515,7 +1482,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -1547,7 +1513,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -1560,7 +1526,6 @@
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           looksLikeFunctionBody(;)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               inPlainSync()
                               listener: handleIdentifier(import, expression)
@@ -1575,7 +1540,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(x, expression)
                                               listener: handleNoTypeArguments(-)
@@ -1594,7 +1558,7 @@
                 ensureSemicolon())
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -1635,7 +1599,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -1648,7 +1612,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -1680,7 +1643,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -1693,7 +1656,6 @@
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           looksLikeFunctionBody(;)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               inPlainSync()
                               listener: handleIdentifier(interface, expression)
@@ -1708,7 +1670,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(x, expression)
                                               listener: handleNoTypeArguments(-)
@@ -1727,7 +1688,7 @@
                 ensureSemicolon())
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -1768,7 +1729,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -1781,7 +1742,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -1813,7 +1773,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -1826,7 +1786,6 @@
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           looksLikeFunctionBody(;)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               inPlainSync()
                               listener: handleIdentifier(library, expression)
@@ -1841,7 +1800,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(x, expression)
                                               listener: handleNoTypeArguments(-)
@@ -1860,7 +1818,7 @@
                 ensureSemicolon())
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -1901,7 +1859,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -1914,7 +1872,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -1946,7 +1903,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -1959,7 +1916,6 @@
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           looksLikeFunctionBody(;)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               inPlainSync()
                               listener: handleIdentifier(operator, expression)
@@ -1974,7 +1930,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(x, expression)
                                               listener: handleNoTypeArguments(-)
@@ -1993,7 +1948,7 @@
                 ensureSemicolon())
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -2034,7 +1989,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -2047,7 +2002,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -2079,7 +2033,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -2092,7 +2046,6 @@
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           looksLikeFunctionBody(;)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               inPlainSync()
                               listener: handleIdentifier(mixin, expression)
@@ -2107,7 +2060,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(x, expression)
                                               listener: handleNoTypeArguments(-)
@@ -2126,7 +2078,7 @@
                 ensureSemicolon())
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -2167,7 +2119,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -2180,7 +2132,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -2212,7 +2163,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -2225,7 +2176,6 @@
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           looksLikeFunctionBody(;)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               inPlainSync()
                               listener: handleIdentifier(part, expression)
@@ -2240,7 +2190,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(x, expression)
                                               listener: handleNoTypeArguments(-)
@@ -2259,7 +2208,7 @@
                 ensureSemicolon())
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -2300,7 +2249,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -2313,7 +2262,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -2345,7 +2293,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -2358,7 +2306,6 @@
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           looksLikeFunctionBody(;)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               inPlainSync()
                               listener: handleIdentifier(set, expression)
@@ -2373,7 +2320,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(x, expression)
                                               listener: handleNoTypeArguments(-)
@@ -2392,7 +2338,7 @@
                 ensureSemicolon())
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -2433,7 +2379,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -2446,7 +2392,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -2478,7 +2423,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -2491,7 +2436,6 @@
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           looksLikeFunctionBody(;)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               inPlainSync()
                               listener: handleIdentifier(static, expression)
@@ -2506,7 +2450,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(x, expression)
                                               listener: handleNoTypeArguments(-)
@@ -2525,7 +2468,7 @@
                 ensureSemicolon())
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
@@ -2566,7 +2509,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -2579,7 +2522,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(==)
@@ -2611,7 +2553,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -2624,7 +2566,6 @@
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           looksLikeFunctionBody(;)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               inPlainSync()
                               listener: handleIdentifier(typedef, expression)
@@ -2639,7 +2580,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(x, expression)
                                               listener: handleNoTypeArguments(-)
@@ -2658,7 +2598,7 @@
                 ensureSemicolon())
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(int, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/general/call_on_after_try_block.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/call_on_after_try_block.dart.intertwined.expect
index 9cecbf9..836c1c5 100644
--- a/pkg/front_end/parser_testcases/general/call_on_after_try_block.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/call_on_after_try_block.dart.intertwined.expect
@@ -25,7 +25,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, try)
+          notEofOrType(CLOSE_CURLY_BRACKET, try)
           parseStatement({)
             parseStatementX({)
               parseTryStatement({)
@@ -33,12 +33,12 @@
                 parseBlock(try, BlockKind(try statement))
                   ensureBlock(try, BlockKind(try statement))
                   listener: beginBlock({, BlockKind(try statement))
-                  notEofOrValue(}, ;)
+                  notEofOrType(CLOSE_CURLY_BRACKET, ;)
                   parseStatement({)
                     parseStatementX({)
                       parseEmptyStatement({)
                         listener: handleEmptyStatement(;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlock(1, {, }, BlockKind(try statement))
                 listener: beginCatchClause(catch)
                 parseFormalParameters(catch, MemberKind.Catch)
@@ -59,12 +59,12 @@
                 parseBlock(), BlockKind(catch clause))
                   ensureBlock(), BlockKind(catch clause))
                   listener: beginBlock({, BlockKind(catch clause))
-                  notEofOrValue(}, ;)
+                  notEofOrType(CLOSE_CURLY_BRACKET, ;)
                   parseStatement({)
                     parseStatementX({)
                       parseEmptyStatement({)
                         listener: handleEmptyStatement(;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlock(1, {, }, BlockKind(catch clause))
                 listener: handleCatchBlock(null, catch, null)
                 listener: beginCatchClause(on)
@@ -75,12 +75,12 @@
                 parseBlock(Foo, BlockKind(catch clause))
                   ensureBlock(Foo, BlockKind(catch clause))
                   listener: beginBlock({, BlockKind(catch clause))
-                  notEofOrValue(}, ;)
+                  notEofOrType(CLOSE_CURLY_BRACKET, ;)
                   parseStatement({)
                     parseStatementX({)
                       parseEmptyStatement({)
                         listener: handleEmptyStatement(;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlock(1, {, }, BlockKind(catch clause))
                 listener: handleCatchBlock(on, null, null)
                 listener: beginCatchClause(on)
@@ -114,16 +114,16 @@
                       rewriter()
                       rewriter()
                   listener: beginBlock({, BlockKind(catch clause))
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlock(0, {, }, BlockKind(catch clause))
                 listener: handleCatchBlock(on, null, null)
                 listener: endTryStatement(3, try, null, })
-          notEofOrValue(}, ;)
+          notEofOrType(CLOSE_CURLY_BRACKET, ;)
           parseStatement(})
             parseStatementX(})
               parseEmptyStatement(})
                 listener: handleEmptyStatement(;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -160,7 +160,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/general/call_on_after_try_block2.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/call_on_after_try_block2.dart.intertwined.expect
index 1106073..ce5a0d5 100644
--- a/pkg/front_end/parser_testcases/general/call_on_after_try_block2.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/call_on_after_try_block2.dart.intertwined.expect
@@ -25,7 +25,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, try)
+          notEofOrType(CLOSE_CURLY_BRACKET, try)
           parseStatement({)
             parseStatementX({)
               parseTryStatement({)
@@ -33,12 +33,12 @@
                 parseBlock(try, BlockKind(try statement))
                   ensureBlock(try, BlockKind(try statement))
                   listener: beginBlock({, BlockKind(try statement))
-                  notEofOrValue(}, ;)
+                  notEofOrType(CLOSE_CURLY_BRACKET, ;)
                   parseStatement({)
                     parseStatementX({)
                       parseEmptyStatement({)
                         listener: handleEmptyStatement(;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlock(1, {, }, BlockKind(try statement))
                 listener: beginCatchClause(catch)
                 parseFormalParameters(catch, MemberKind.Catch)
@@ -59,12 +59,12 @@
                 parseBlock(), BlockKind(catch clause))
                   ensureBlock(), BlockKind(catch clause))
                   listener: beginBlock({, BlockKind(catch clause))
-                  notEofOrValue(}, ;)
+                  notEofOrType(CLOSE_CURLY_BRACKET, ;)
                   parseStatement({)
                     parseStatementX({)
                       parseEmptyStatement({)
                         listener: handleEmptyStatement(;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlock(1, {, }, BlockKind(catch clause))
                 listener: handleCatchBlock(null, catch, null)
                 listener: beginCatchClause(on)
@@ -75,12 +75,12 @@
                 parseBlock(Foo, BlockKind(catch clause))
                   ensureBlock(Foo, BlockKind(catch clause))
                   listener: beginBlock({, BlockKind(catch clause))
-                  notEofOrValue(}, ;)
+                  notEofOrType(CLOSE_CURLY_BRACKET, ;)
                   parseStatement({)
                     parseStatementX({)
                       parseEmptyStatement({)
                         listener: handleEmptyStatement(;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlock(1, {, }, BlockKind(catch clause))
                 listener: handleCatchBlock(on, null, null)
                 listener: beginCatchClause(on)
@@ -103,12 +103,12 @@
                 parseBlock(), BlockKind(catch clause))
                   ensureBlock(), BlockKind(catch clause))
                   listener: beginBlock({, BlockKind(catch clause))
-                  notEofOrValue(}, ;)
+                  notEofOrType(CLOSE_CURLY_BRACKET, ;)
                   parseStatement({)
                     parseStatementX({)
                       parseEmptyStatement({)
                         listener: handleEmptyStatement(;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlock(1, {, }, BlockKind(catch clause))
                 listener: handleCatchBlock(on, null, null)
                 listener: beginCatchClause(on)
@@ -142,16 +142,16 @@
                       rewriter()
                       rewriter()
                   listener: beginBlock({, BlockKind(catch clause))
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlock(0, {, }, BlockKind(catch clause))
                 listener: handleCatchBlock(on, null, null)
                 listener: endTryStatement(4, try, null, })
-          notEofOrValue(}, ;)
+          notEofOrType(CLOSE_CURLY_BRACKET, ;)
           parseStatement(})
             parseStatementX(})
               parseEmptyStatement(})
                 listener: handleEmptyStatement(;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/general/call_on_after_try_block2_prime.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/call_on_after_try_block2_prime.dart.intertwined.expect
index 6ed3d52..d8fc454 100644
--- a/pkg/front_end/parser_testcases/general/call_on_after_try_block2_prime.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/call_on_after_try_block2_prime.dart.intertwined.expect
@@ -25,7 +25,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, try)
+          notEofOrType(CLOSE_CURLY_BRACKET, try)
           parseStatement({)
             parseStatementX({)
               parseTryStatement({)
@@ -33,12 +33,12 @@
                 parseBlock(try, BlockKind(try statement))
                   ensureBlock(try, BlockKind(try statement))
                   listener: beginBlock({, BlockKind(try statement))
-                  notEofOrValue(}, ;)
+                  notEofOrType(CLOSE_CURLY_BRACKET, ;)
                   parseStatement({)
                     parseStatementX({)
                       parseEmptyStatement({)
                         listener: handleEmptyStatement(;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlock(1, {, }, BlockKind(try statement))
                 listener: beginCatchClause(catch)
                 parseFormalParameters(catch, MemberKind.Catch)
@@ -59,12 +59,12 @@
                 parseBlock(), BlockKind(catch clause))
                   ensureBlock(), BlockKind(catch clause))
                   listener: beginBlock({, BlockKind(catch clause))
-                  notEofOrValue(}, ;)
+                  notEofOrType(CLOSE_CURLY_BRACKET, ;)
                   parseStatement({)
                     parseStatementX({)
                       parseEmptyStatement({)
                         listener: handleEmptyStatement(;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlock(1, {, }, BlockKind(catch clause))
                 listener: handleCatchBlock(null, catch, null)
                 listener: beginCatchClause(on)
@@ -75,16 +75,16 @@
                 parseBlock(Foo, BlockKind(catch clause))
                   ensureBlock(Foo, BlockKind(catch clause))
                   listener: beginBlock({, BlockKind(catch clause))
-                  notEofOrValue(}, ;)
+                  notEofOrType(CLOSE_CURLY_BRACKET, ;)
                   parseStatement({)
                     parseStatementX({)
                       parseEmptyStatement({)
                         listener: handleEmptyStatement(;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlock(1, {, }, BlockKind(catch clause))
                 listener: handleCatchBlock(on, null, null)
                 listener: endTryStatement(2, try, null, })
-          notEofOrValue(}, onX)
+          notEofOrType(CLOSE_CURLY_BRACKET, onX)
           parseStatement(})
             parseStatementX(})
               parseExpressionStatementOrDeclarationAfterModifiers(}, }, null, null, null, null)
@@ -121,15 +121,15 @@
                       inPlainSync()
                     parseFunctionBody(), false, false)
                       listener: beginBlockFunctionBody({)
-                      notEofOrValue(}, ;)
+                      notEofOrType(CLOSE_CURLY_BRACKET, ;)
                       parseStatement({)
                         parseStatementX({)
                           parseEmptyStatement({)
                             listener: handleEmptyStatement(;)
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlockFunctionBody(1, {, })
                   listener: endLocalFunctionDeclaration(})
-          notEofOrValue(}, onX)
+          notEofOrType(CLOSE_CURLY_BRACKET, onX)
           parseStatement(})
             parseStatementX(})
               parseExpressionStatementOrDeclarationAfterModifiers(}, }, null, null, null, null)
@@ -142,7 +142,6 @@
                           parseSendOrFunctionLiteral(}, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend(}, expression, ConstantPatternContext.none)
-                              isNextIdentifier(})
                               ensureIdentifier(}, expression)
                                 listener: handleIdentifier(onX, expression)
                               listener: handleNoTypeArguments(()
@@ -162,7 +161,7 @@
                               listener: handleSend(onX, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(onX, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(3, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/general/call_on_after_try_block3.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/call_on_after_try_block3.dart.intertwined.expect
index 72cf0c0..63cb170 100644
--- a/pkg/front_end/parser_testcases/general/call_on_after_try_block3.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/call_on_after_try_block3.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, try)
+          notEofOrType(CLOSE_CURLY_BRACKET, try)
           parseStatement({)
             parseStatementX({)
               parseTryStatement({)
@@ -46,12 +46,12 @@
                 parseBlock(try, BlockKind(try statement))
                   ensureBlock(try, BlockKind(try statement))
                   listener: beginBlock({, BlockKind(try statement))
-                  notEofOrValue(}, ;)
+                  notEofOrType(CLOSE_CURLY_BRACKET, ;)
                   parseStatement({)
                     parseStatementX({)
                       parseEmptyStatement({)
                         listener: handleEmptyStatement(;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlock(1, {, }, BlockKind(try statement))
                 listener: beginCatchClause(catch)
                 parseFormalParameters(catch, MemberKind.Catch)
@@ -72,12 +72,12 @@
                 parseBlock(), BlockKind(catch clause))
                   ensureBlock(), BlockKind(catch clause))
                   listener: beginBlock({, BlockKind(catch clause))
-                  notEofOrValue(}, ;)
+                  notEofOrType(CLOSE_CURLY_BRACKET, ;)
                   parseStatement({)
                     parseStatementX({)
                       parseEmptyStatement({)
                         listener: handleEmptyStatement(;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlock(1, {, }, BlockKind(catch clause))
                 listener: handleCatchBlock(null, catch, null)
                 listener: beginCatchClause(on)
@@ -88,12 +88,12 @@
                 parseBlock(Foo, BlockKind(catch clause))
                   ensureBlock(Foo, BlockKind(catch clause))
                   listener: beginBlock({, BlockKind(catch clause))
-                  notEofOrValue(}, ;)
+                  notEofOrType(CLOSE_CURLY_BRACKET, ;)
                   parseStatement({)
                     parseStatementX({)
                       parseEmptyStatement({)
                         listener: handleEmptyStatement(;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlock(1, {, }, BlockKind(catch clause))
                 listener: handleCatchBlock(on, null, null)
                 listener: beginCatchClause(on)
@@ -118,11 +118,11 @@
                       rewriter()
                       rewriter()
                   listener: beginBlock({, BlockKind(catch clause))
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlock(0, {, }, BlockKind(catch clause))
                 listener: handleCatchBlock(on, null, null)
                 listener: endTryStatement(3, try, null, })
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(})
             parseStatementX(})
               parseExpressionStatementOrDeclaration(}, null)
@@ -140,7 +140,7 @@
                                 listener: endRecordLiteral((, 0, null)
                     ensureSemicolon())
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/general/call_on_after_try_block3_prime.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/call_on_after_try_block3_prime.dart.intertwined.expect
index 1475041..2646741 100644
--- a/pkg/front_end/parser_testcases/general/call_on_after_try_block3_prime.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/call_on_after_try_block3_prime.dart.intertwined.expect
@@ -37,7 +37,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, try)
+          notEofOrType(CLOSE_CURLY_BRACKET, try)
           parseStatement({)
             parseStatementX({)
               parseTryStatement({)
@@ -45,12 +45,12 @@
                 parseBlock(try, BlockKind(try statement))
                   ensureBlock(try, BlockKind(try statement))
                   listener: beginBlock({, BlockKind(try statement))
-                  notEofOrValue(}, ;)
+                  notEofOrType(CLOSE_CURLY_BRACKET, ;)
                   parseStatement({)
                     parseStatementX({)
                       parseEmptyStatement({)
                         listener: handleEmptyStatement(;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlock(1, {, }, BlockKind(try statement))
                 listener: beginCatchClause(catch)
                 parseFormalParameters(catch, MemberKind.Catch)
@@ -71,12 +71,12 @@
                 parseBlock(), BlockKind(catch clause))
                   ensureBlock(), BlockKind(catch clause))
                   listener: beginBlock({, BlockKind(catch clause))
-                  notEofOrValue(}, ;)
+                  notEofOrType(CLOSE_CURLY_BRACKET, ;)
                   parseStatement({)
                     parseStatementX({)
                       parseEmptyStatement({)
                         listener: handleEmptyStatement(;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlock(1, {, }, BlockKind(catch clause))
                 listener: handleCatchBlock(null, catch, null)
                 listener: beginCatchClause(on)
@@ -87,16 +87,16 @@
                 parseBlock(Foo, BlockKind(catch clause))
                   ensureBlock(Foo, BlockKind(catch clause))
                   listener: beginBlock({, BlockKind(catch clause))
-                  notEofOrValue(}, ;)
+                  notEofOrType(CLOSE_CURLY_BRACKET, ;)
                   parseStatement({)
                     parseStatementX({)
                       parseEmptyStatement({)
                         listener: handleEmptyStatement(;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlock(1, {, }, BlockKind(catch clause))
                 listener: handleCatchBlock(on, null, null)
                 listener: endTryStatement(2, try, null, })
-          notEofOrValue(}, onX)
+          notEofOrType(CLOSE_CURLY_BRACKET, onX)
           parseStatement(})
             parseStatementX(})
               parseExpressionStatementOrDeclarationAfterModifiers(}, }, null, null, null, null)
@@ -108,7 +108,6 @@
                         parsePrimary(}, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(}, expression, ConstantPatternContext.none)
                             parseSend(}, expression, ConstantPatternContext.none)
-                              isNextIdentifier(})
                               ensureIdentifier(}, expression)
                                 listener: handleIdentifier(onX, expression)
                               listener: handleNoTypeArguments(.)
@@ -118,7 +117,6 @@
                       parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                         parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                           parseSend(., expressionContinuation, ConstantPatternContext.none)
-                            isNextIdentifier(.)
                             ensureIdentifier(., expressionContinuation)
                               listener: handleIdentifier(toString, expressionContinuation)
                             listener: handleNoTypeArguments(()
@@ -131,7 +129,7 @@
                       listener: handleEndingBinaryExpression(., ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(onX, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/general/call_on_after_try_block4.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/call_on_after_try_block4.dart.intertwined.expect
index 8710cd2..1f25fdd 100644
--- a/pkg/front_end/parser_testcases/general/call_on_after_try_block4.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/call_on_after_try_block4.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, try)
+          notEofOrType(CLOSE_CURLY_BRACKET, try)
           parseStatement({)
             parseStatementX({)
               parseTryStatement({)
@@ -46,12 +46,12 @@
                 parseBlock(try, BlockKind(try statement))
                   ensureBlock(try, BlockKind(try statement))
                   listener: beginBlock({, BlockKind(try statement))
-                  notEofOrValue(}, ;)
+                  notEofOrType(CLOSE_CURLY_BRACKET, ;)
                   parseStatement({)
                     parseStatementX({)
                       parseEmptyStatement({)
                         listener: handleEmptyStatement(;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlock(1, {, }, BlockKind(try statement))
                 listener: beginCatchClause(catch)
                 parseFormalParameters(catch, MemberKind.Catch)
@@ -72,12 +72,12 @@
                 parseBlock(), BlockKind(catch clause))
                   ensureBlock(), BlockKind(catch clause))
                   listener: beginBlock({, BlockKind(catch clause))
-                  notEofOrValue(}, ;)
+                  notEofOrType(CLOSE_CURLY_BRACKET, ;)
                   parseStatement({)
                     parseStatementX({)
                       parseEmptyStatement({)
                         listener: handleEmptyStatement(;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlock(1, {, }, BlockKind(catch clause))
                 listener: handleCatchBlock(null, catch, null)
                 listener: beginCatchClause(on)
@@ -88,12 +88,12 @@
                 parseBlock(Foo, BlockKind(catch clause))
                   ensureBlock(Foo, BlockKind(catch clause))
                   listener: beginBlock({, BlockKind(catch clause))
-                  notEofOrValue(}, ;)
+                  notEofOrType(CLOSE_CURLY_BRACKET, ;)
                   parseStatement({)
                     parseStatementX({)
                       parseEmptyStatement({)
                         listener: handleEmptyStatement(;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlock(1, {, }, BlockKind(catch clause))
                 listener: handleCatchBlock(on, null, null)
                 listener: beginCatchClause(on)
@@ -112,11 +112,11 @@
                       rewriter()
                       rewriter()
                   listener: beginBlock({, BlockKind(catch clause))
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlock(0, {, }, BlockKind(catch clause))
                 listener: handleCatchBlock(on, null, null)
                 listener: endTryStatement(3, try, null, })
-          notEofOrValue(}, =)
+          notEofOrType(CLOSE_CURLY_BRACKET, =)
           parseStatement(})
             parseStatementX(})
               parseExpressionStatementOrDeclaration(}, null)
@@ -128,7 +128,6 @@
                         parseUnaryExpression(}, true, ConstantPatternContext.none)
                           parsePrimary(}, expression, ConstantPatternContext.none)
                             parseSend(}, expression, ConstantPatternContext.none)
-                              isNextIdentifier(})
                               ensureIdentifier(}, expression)
                                 reportRecoverableErrorWithToken(=, Template(ExpectedIdentifier))
                                   listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got '='., Try inserting an identifier before '='., {lexeme: =}], =, =)
@@ -146,7 +145,7 @@
                         listener: handleAssignmentExpression(=, 42)
                     ensureSemicolon(42)
                     listener: handleExpressionStatement(=, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/general/call_on_after_try_block4_prime.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/call_on_after_try_block4_prime.dart.intertwined.expect
index a3a001b..e10c12d 100644
--- a/pkg/front_end/parser_testcases/general/call_on_after_try_block4_prime.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/call_on_after_try_block4_prime.dart.intertwined.expect
@@ -37,7 +37,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, try)
+          notEofOrType(CLOSE_CURLY_BRACKET, try)
           parseStatement({)
             parseStatementX({)
               parseTryStatement({)
@@ -45,12 +45,12 @@
                 parseBlock(try, BlockKind(try statement))
                   ensureBlock(try, BlockKind(try statement))
                   listener: beginBlock({, BlockKind(try statement))
-                  notEofOrValue(}, ;)
+                  notEofOrType(CLOSE_CURLY_BRACKET, ;)
                   parseStatement({)
                     parseStatementX({)
                       parseEmptyStatement({)
                         listener: handleEmptyStatement(;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlock(1, {, }, BlockKind(try statement))
                 listener: beginCatchClause(catch)
                 parseFormalParameters(catch, MemberKind.Catch)
@@ -71,12 +71,12 @@
                 parseBlock(), BlockKind(catch clause))
                   ensureBlock(), BlockKind(catch clause))
                   listener: beginBlock({, BlockKind(catch clause))
-                  notEofOrValue(}, ;)
+                  notEofOrType(CLOSE_CURLY_BRACKET, ;)
                   parseStatement({)
                     parseStatementX({)
                       parseEmptyStatement({)
                         listener: handleEmptyStatement(;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlock(1, {, }, BlockKind(catch clause))
                 listener: handleCatchBlock(null, catch, null)
                 listener: beginCatchClause(on)
@@ -87,16 +87,16 @@
                 parseBlock(Foo, BlockKind(catch clause))
                   ensureBlock(Foo, BlockKind(catch clause))
                   listener: beginBlock({, BlockKind(catch clause))
-                  notEofOrValue(}, ;)
+                  notEofOrType(CLOSE_CURLY_BRACKET, ;)
                   parseStatement({)
                     parseStatementX({)
                       parseEmptyStatement({)
                         listener: handleEmptyStatement(;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlock(1, {, }, BlockKind(catch clause))
                 listener: handleCatchBlock(on, null, null)
                 listener: endTryStatement(2, try, null, })
-          notEofOrValue(}, onX)
+          notEofOrType(CLOSE_CURLY_BRACKET, onX)
           parseStatement(})
             parseStatementX(})
               parseExpressionStatementOrDeclarationAfterModifiers(}, }, null, null, null, null)
@@ -108,7 +108,6 @@
                         parsePrimary(}, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(}, expression, ConstantPatternContext.none)
                             parseSend(}, expression, ConstantPatternContext.none)
-                              isNextIdentifier(})
                               ensureIdentifier(}, expression)
                                 listener: handleIdentifier(onX, expression)
                               listener: handleNoTypeArguments(=)
@@ -123,7 +122,7 @@
                       listener: handleAssignmentExpression(=, 42)
                   ensureSemicolon(42)
                   listener: handleExpressionStatement(onX, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/general/call_on_after_try_block5.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/call_on_after_try_block5.dart.intertwined.expect
index 70a5a90..2510e4f 100644
--- a/pkg/front_end/parser_testcases/general/call_on_after_try_block5.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/call_on_after_try_block5.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, try)
+          notEofOrType(CLOSE_CURLY_BRACKET, try)
           parseStatement({)
             parseStatementX({)
               parseTryStatement({)
@@ -46,12 +46,12 @@
                 parseBlock(try, BlockKind(try statement))
                   ensureBlock(try, BlockKind(try statement))
                   listener: beginBlock({, BlockKind(try statement))
-                  notEofOrValue(}, ;)
+                  notEofOrType(CLOSE_CURLY_BRACKET, ;)
                   parseStatement({)
                     parseStatementX({)
                       parseEmptyStatement({)
                         listener: handleEmptyStatement(;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlock(1, {, }, BlockKind(try statement))
                 listener: beginCatchClause(catch)
                 parseFormalParameters(catch, MemberKind.Catch)
@@ -72,12 +72,12 @@
                 parseBlock(), BlockKind(catch clause))
                   ensureBlock(), BlockKind(catch clause))
                   listener: beginBlock({, BlockKind(catch clause))
-                  notEofOrValue(}, ;)
+                  notEofOrType(CLOSE_CURLY_BRACKET, ;)
                   parseStatement({)
                     parseStatementX({)
                       parseEmptyStatement({)
                         listener: handleEmptyStatement(;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlock(1, {, }, BlockKind(catch clause))
                 listener: handleCatchBlock(null, catch, null)
                 listener: beginCatchClause(on)
@@ -88,12 +88,12 @@
                 parseBlock(Foo, BlockKind(catch clause))
                   ensureBlock(Foo, BlockKind(catch clause))
                   listener: beginBlock({, BlockKind(catch clause))
-                  notEofOrValue(}, ;)
+                  notEofOrType(CLOSE_CURLY_BRACKET, ;)
                   parseStatement({)
                     parseStatementX({)
                       parseEmptyStatement({)
                         listener: handleEmptyStatement(;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlock(1, {, }, BlockKind(catch clause))
                 listener: handleCatchBlock(on, null, null)
                 listener: beginCatchClause(on)
@@ -112,16 +112,16 @@
                       rewriter()
                       rewriter()
                   listener: beginBlock({, BlockKind(catch clause))
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlock(0, {, }, BlockKind(catch clause))
                 listener: handleCatchBlock(on, null, null)
                 listener: endTryStatement(3, try, null, })
-          notEofOrValue(}, ;)
+          notEofOrType(CLOSE_CURLY_BRACKET, ;)
           parseStatement(})
             parseStatementX(})
               parseEmptyStatement(})
                 listener: handleEmptyStatement(;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/general/call_on_after_try_block5_prime.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/call_on_after_try_block5_prime.dart.intertwined.expect
index 00a67c8..64d8afe 100644
--- a/pkg/front_end/parser_testcases/general/call_on_after_try_block5_prime.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/call_on_after_try_block5_prime.dart.intertwined.expect
@@ -37,7 +37,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, try)
+          notEofOrType(CLOSE_CURLY_BRACKET, try)
           parseStatement({)
             parseStatementX({)
               parseTryStatement({)
@@ -45,12 +45,12 @@
                 parseBlock(try, BlockKind(try statement))
                   ensureBlock(try, BlockKind(try statement))
                   listener: beginBlock({, BlockKind(try statement))
-                  notEofOrValue(}, ;)
+                  notEofOrType(CLOSE_CURLY_BRACKET, ;)
                   parseStatement({)
                     parseStatementX({)
                       parseEmptyStatement({)
                         listener: handleEmptyStatement(;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlock(1, {, }, BlockKind(try statement))
                 listener: beginCatchClause(catch)
                 parseFormalParameters(catch, MemberKind.Catch)
@@ -71,12 +71,12 @@
                 parseBlock(), BlockKind(catch clause))
                   ensureBlock(), BlockKind(catch clause))
                   listener: beginBlock({, BlockKind(catch clause))
-                  notEofOrValue(}, ;)
+                  notEofOrType(CLOSE_CURLY_BRACKET, ;)
                   parseStatement({)
                     parseStatementX({)
                       parseEmptyStatement({)
                         listener: handleEmptyStatement(;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlock(1, {, }, BlockKind(catch clause))
                 listener: handleCatchBlock(null, catch, null)
                 listener: beginCatchClause(on)
@@ -87,16 +87,16 @@
                 parseBlock(Foo, BlockKind(catch clause))
                   ensureBlock(Foo, BlockKind(catch clause))
                   listener: beginBlock({, BlockKind(catch clause))
-                  notEofOrValue(}, ;)
+                  notEofOrType(CLOSE_CURLY_BRACKET, ;)
                   parseStatement({)
                     parseStatementX({)
                       parseEmptyStatement({)
                         listener: handleEmptyStatement(;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlock(1, {, }, BlockKind(catch clause))
                 listener: handleCatchBlock(on, null, null)
                 listener: endTryStatement(2, try, null, })
-          notEofOrValue(}, onX)
+          notEofOrType(CLOSE_CURLY_BRACKET, onX)
           parseStatement(})
             parseStatementX(})
               parseExpressionStatementOrDeclarationAfterModifiers(}, }, null, null, null, null)
@@ -108,7 +108,6 @@
                         parsePrimary(}, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(}, expression, ConstantPatternContext.none)
                             parseSend(}, expression, ConstantPatternContext.none)
-                              isNextIdentifier(})
                               ensureIdentifier(}, expression)
                                 listener: handleIdentifier(onX, expression)
                               listener: handleNoTypeArguments(;)
@@ -117,7 +116,7 @@
                               listener: handleSend(onX, onX)
                   ensureSemicolon(onX)
                   listener: handleExpressionStatement(onX, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/general/call_on_after_try_block_prime.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/call_on_after_try_block_prime.dart.intertwined.expect
index 588a862..ef469f9 100644
--- a/pkg/front_end/parser_testcases/general/call_on_after_try_block_prime.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/call_on_after_try_block_prime.dart.intertwined.expect
@@ -25,7 +25,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, try)
+          notEofOrType(CLOSE_CURLY_BRACKET, try)
           parseStatement({)
             parseStatementX({)
               parseTryStatement({)
@@ -33,12 +33,12 @@
                 parseBlock(try, BlockKind(try statement))
                   ensureBlock(try, BlockKind(try statement))
                   listener: beginBlock({, BlockKind(try statement))
-                  notEofOrValue(}, ;)
+                  notEofOrType(CLOSE_CURLY_BRACKET, ;)
                   parseStatement({)
                     parseStatementX({)
                       parseEmptyStatement({)
                         listener: handleEmptyStatement(;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlock(1, {, }, BlockKind(try statement))
                 listener: beginCatchClause(catch)
                 parseFormalParameters(catch, MemberKind.Catch)
@@ -59,12 +59,12 @@
                 parseBlock(), BlockKind(catch clause))
                   ensureBlock(), BlockKind(catch clause))
                   listener: beginBlock({, BlockKind(catch clause))
-                  notEofOrValue(}, ;)
+                  notEofOrType(CLOSE_CURLY_BRACKET, ;)
                   parseStatement({)
                     parseStatementX({)
                       parseEmptyStatement({)
                         listener: handleEmptyStatement(;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlock(1, {, }, BlockKind(catch clause))
                 listener: handleCatchBlock(null, catch, null)
                 listener: beginCatchClause(on)
@@ -75,16 +75,16 @@
                 parseBlock(Foo, BlockKind(catch clause))
                   ensureBlock(Foo, BlockKind(catch clause))
                   listener: beginBlock({, BlockKind(catch clause))
-                  notEofOrValue(}, ;)
+                  notEofOrType(CLOSE_CURLY_BRACKET, ;)
                   parseStatement({)
                     parseStatementX({)
                       parseEmptyStatement({)
                         listener: handleEmptyStatement(;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlock(1, {, }, BlockKind(catch clause))
                 listener: handleCatchBlock(on, null, null)
                 listener: endTryStatement(2, try, null, })
-          notEofOrValue(}, onX)
+          notEofOrType(CLOSE_CURLY_BRACKET, onX)
           parseStatement(})
             parseStatementX(})
               parseExpressionStatementOrDeclarationAfterModifiers(}, }, null, null, null, null)
@@ -97,7 +97,6 @@
                           parseSendOrFunctionLiteral(}, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend(}, expression, ConstantPatternContext.none)
-                              isNextIdentifier(})
                               ensureIdentifier(}, expression)
                                 listener: handleIdentifier(onX, expression)
                               listener: handleNoTypeArguments(()
@@ -115,7 +114,7 @@
                               listener: handleSend(onX, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(onX, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -152,7 +151,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/general/chained_call_01.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/chained_call_01.dart.intertwined.expect
index 45a3129..bd1d457 100644
--- a/pkg/front_end/parser_testcases/general/chained_call_01.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/chained_call_01.dart.intertwined.expect
@@ -37,7 +37,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, e)
+          notEofOrType(CLOSE_CURLY_BRACKET, e)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -50,7 +50,6 @@
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(()
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(e, expression)
                               listener: handleNoTypeArguments(()
@@ -69,7 +68,7 @@
                         listener: handleSend((, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(e, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/general/chained_call_02.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/chained_call_02.dart.intertwined.expect
index 6d02c7e..3449a00 100644
--- a/pkg/front_end/parser_testcases/general/chained_call_02.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/chained_call_02.dart.intertwined.expect
@@ -37,7 +37,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, e)
+          notEofOrType(CLOSE_CURLY_BRACKET, e)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -50,7 +50,6 @@
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(<)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(e, expression)
                               listener: handleNoTypeArguments(()
@@ -73,7 +72,7 @@
                         listener: handleSend((, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(e, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/general/chained_call_03.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/chained_call_03.dart.intertwined.expect
index 538b374..c21ea64 100644
--- a/pkg/front_end/parser_testcases/general/chained_call_03.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/chained_call_03.dart.intertwined.expect
@@ -37,7 +37,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, e)
+          notEofOrType(CLOSE_CURLY_BRACKET, e)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -49,7 +49,6 @@
                         parsePrimary({, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(e, expression)
                               listener: handleNoTypeArguments(.)
@@ -59,7 +58,6 @@
                       parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                         parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                           parseSend(., expressionContinuation, ConstantPatternContext.none)
-                            isNextIdentifier(.)
                             ensureIdentifier(., expressionContinuation)
                               listener: handleIdentifier(f, expressionContinuation)
                             listener: handleNoTypeArguments(()
@@ -79,7 +77,7 @@
                         listener: handleSend((, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(e, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/general/chained_call_04.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/chained_call_04.dart.intertwined.expect
index b816461..bdeb9c9 100644
--- a/pkg/front_end/parser_testcases/general/chained_call_04.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/chained_call_04.dart.intertwined.expect
@@ -37,7 +37,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, e)
+          notEofOrType(CLOSE_CURLY_BRACKET, e)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -49,7 +49,6 @@
                         parsePrimary({, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(e, expression)
                               listener: handleNoTypeArguments(.)
@@ -59,7 +58,6 @@
                       parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                         parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                           parseSend(., expressionContinuation, ConstantPatternContext.none)
-                            isNextIdentifier(.)
                             ensureIdentifier(., expressionContinuation)
                               listener: handleIdentifier(f, expressionContinuation)
                             listener: handleNoTypeArguments(()
@@ -83,7 +81,7 @@
                         listener: handleSend((, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(e, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/general/chained_call_05.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/chained_call_05.dart.intertwined.expect
index 6dfa378..f6ab158 100644
--- a/pkg/front_end/parser_testcases/general/chained_call_05.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/chained_call_05.dart.intertwined.expect
@@ -37,7 +37,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -58,7 +58,6 @@
                                         parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                           looksLikeFunctionBody())
                                           parseSend((, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(()
                                             ensureIdentifier((, expression)
                                               listener: handleIdentifier(e, expression)
                                             listener: handleNoTypeArguments(()
@@ -83,7 +82,7 @@
                           listener: handleSend((, ))
                     ensureSemicolon())
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/general/chained_call_06.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/chained_call_06.dart.intertwined.expect
index ea3d879..cd90a77 100644
--- a/pkg/front_end/parser_testcases/general/chained_call_06.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/chained_call_06.dart.intertwined.expect
@@ -37,7 +37,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -57,7 +57,6 @@
                                       parsePrimary((, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                           parseSend((, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(()
                                             ensureIdentifier((, expression)
                                               listener: handleIdentifier(e, expression)
                                             listener: handleNoTypeArguments(.)
@@ -67,7 +66,6 @@
                                     parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                         parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                          isNextIdentifier(.)
                                           ensureIdentifier(., expressionContinuation)
                                             listener: handleIdentifier(f, expressionContinuation)
                                           listener: handleNoTypeArguments(()
@@ -93,7 +91,7 @@
                           listener: handleSend((, ))
                     ensureSemicolon())
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/general/chained_call_07.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/chained_call_07.dart.intertwined.expect
index d3df5f0..5e6448f 100644
--- a/pkg/front_end/parser_testcases/general/chained_call_07.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/chained_call_07.dart.intertwined.expect
@@ -37,7 +37,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, e)
+          notEofOrType(CLOSE_CURLY_BRACKET, e)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -49,7 +49,6 @@
                         parsePrimary({, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(e, expression)
                               listener: handleNoTypeArguments(.)
@@ -59,7 +58,6 @@
                       parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                         parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                           parseSend(., expressionContinuation, ConstantPatternContext.none)
-                            isNextIdentifier(.)
                             ensureIdentifier(., expressionContinuation)
                               listener: handleIdentifier(f, expressionContinuation)
                             listener: beginTypeArguments(<)
@@ -97,7 +95,7 @@
                         listener: handleSend((, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(e, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/general/for.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/for.dart.intertwined.expect
index 44de060..d637216c 100644
--- a/pkg/front_end/parser_testcases/general/for.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/for.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, for)
+          notEofOrType(CLOSE_CURLY_BRACKET, for)
           parseStatement({)
             parseStatementX({)
               parseForStatement({, null)
@@ -68,7 +68,6 @@
                             parsePrimary(;, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                                 parseSend(;, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(;)
                                   ensureIdentifier(;, expression)
                                     listener: handleIdentifier(i, expression)
                                   listener: handleNoTypeArguments(<)
@@ -90,7 +89,6 @@
                           parsePrimary(;, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                               parseSend(;, expression, ConstantPatternContext.none)
-                                isNextIdentifier(;)
                                 ensureIdentifier(;, expression)
                                   listener: handleIdentifier(i, expression)
                                 listener: handleNoTypeArguments(++)
@@ -105,11 +103,11 @@
                       parseBlock(), BlockKind(statement))
                         ensureBlock(), BlockKind(statement))
                         listener: beginBlock({, BlockKind(statement))
-                        notEofOrValue(}, })
+                        notEofOrType(CLOSE_CURLY_BRACKET, })
                         listener: endBlock(0, {, }, BlockKind(statement))
                   listener: endForStatementBody(})
                   listener: endForStatement(})
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/general/for_in.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/for_in.dart.intertwined.expect
index 5064500..a799955 100644
--- a/pkg/front_end/parser_testcases/general/for_in.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/for_in.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, for)
+          notEofOrType(CLOSE_CURLY_BRACKET, for)
           parseStatement({)
             parseStatementX({)
               parseForStatement({, null)
@@ -71,11 +71,11 @@
                       parseBlock(), BlockKind(statement))
                         ensureBlock(), BlockKind(statement))
                         listener: beginBlock({, BlockKind(statement))
-                        notEofOrValue(}, })
+                        notEofOrType(CLOSE_CURLY_BRACKET, })
                         listener: endBlock(0, {, }, BlockKind(statement))
                   listener: endForInBody(})
                   listener: endForIn(})
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/general/for_in_no_decl.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/for_in_no_decl.dart.intertwined.expect
index efceca9..8fc8ade 100644
--- a/pkg/front_end/parser_testcases/general/for_in_no_decl.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/for_in_no_decl.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
@@ -45,7 +45,7 @@
                     listener: endInitializedIdentifier(i)
                   ensureSemicolon(i)
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, for)
+          notEofOrType(CLOSE_CURLY_BRACKET, for)
           parseStatement(;)
             parseStatementX(;)
               parseForStatement(;, null)
@@ -60,7 +60,6 @@
                         parsePrimary((, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                             parseSend((, expression, ConstantPatternContext.none)
-                              isNextIdentifier(()
                               ensureIdentifier((, expression)
                                 listener: handleIdentifier(i, expression)
                               listener: handleNoTypeArguments(in)
@@ -90,11 +89,11 @@
                       parseBlock(), BlockKind(statement))
                         ensureBlock(), BlockKind(statement))
                         listener: beginBlock({, BlockKind(statement))
-                        notEofOrValue(}, })
+                        notEofOrType(CLOSE_CURLY_BRACKET, })
                         listener: endBlock(0, {, }, BlockKind(statement))
                   listener: endForInBody(})
                   listener: endForIn(})
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/general/for_no_decl.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/for_no_decl.dart.intertwined.expect
index 28914ce..b7fabd2 100644
--- a/pkg/front_end/parser_testcases/general/for_no_decl.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/for_no_decl.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, int)
+          notEofOrType(CLOSE_CURLY_BRACKET, int)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -47,7 +47,7 @@
                     listener: endInitializedIdentifier(i)
                   ensureSemicolon(i)
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, for)
+          notEofOrType(CLOSE_CURLY_BRACKET, for)
           parseStatement(;)
             parseStatementX(;)
               parseForStatement(;, null)
@@ -62,7 +62,6 @@
                         parsePrimary((, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                             parseSend((, expression, ConstantPatternContext.none)
-                              isNextIdentifier(()
                               ensureIdentifier((, expression)
                                 listener: handleIdentifier(i, expression)
                               listener: handleNoTypeArguments(=)
@@ -86,7 +85,6 @@
                             parsePrimary(;, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                                 parseSend(;, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(;)
                                   ensureIdentifier(;, expression)
                                     listener: handleIdentifier(i, expression)
                                   listener: handleNoTypeArguments(<)
@@ -108,7 +106,6 @@
                           parsePrimary(;, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                               parseSend(;, expression, ConstantPatternContext.none)
-                                isNextIdentifier(;)
                                 ensureIdentifier(;, expression)
                                   listener: handleIdentifier(i, expression)
                                 listener: handleNoTypeArguments(++)
@@ -123,11 +120,11 @@
                       parseBlock(), BlockKind(statement))
                         ensureBlock(), BlockKind(statement))
                         listener: beginBlock({, BlockKind(statement))
-                        notEofOrValue(}, })
+                        notEofOrType(CLOSE_CURLY_BRACKET, })
                         listener: endBlock(0, {, }, BlockKind(statement))
                   listener: endForStatementBody(})
                   listener: endForStatement(})
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/general/function_declaration.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/function_declaration.dart.intertwined.expect
index 401fa78..f74e1ae 100644
--- a/pkg/front_end/parser_testcases/general/function_declaration.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/function_declaration.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, local)
+          notEofOrType(CLOSE_CURLY_BRACKET, local)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -53,10 +53,10 @@
                       inPlainSync()
                     parseFunctionBody(), false, false)
                       listener: beginBlockFunctionBody({)
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlockFunctionBody(0, {, })
                   listener: endLocalFunctionDeclaration(})
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/general/function_expression.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/function_expression.dart.intertwined.expect
index 7be1884..863a477 100644
--- a/pkg/front_end/parser_testcases/general/function_expression.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/function_expression.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -51,12 +51,12 @@
                                     inPlainSync()
                                   parseFunctionBody(), true, false)
                                     listener: beginBlockFunctionBody({)
-                                    notEofOrValue(}, })
+                                    notEofOrType(CLOSE_CURLY_BRACKET, })
                                     listener: endBlockFunctionBody(0, {, })
                                 listener: endFunctionExpression((, })
                     ensureSemicolon(})
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/general/function_reference_following_token.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/function_reference_following_token.dart.intertwined.expect
index ed26eb8..f5922d4 100644
--- a/pkg/front_end/parser_testcases/general/function_reference_following_token.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/function_reference_following_token.dart.intertwined.expect
@@ -29,7 +29,6 @@
                           parsePrimary({, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                               parseSend({, expression, ConstantPatternContext.none)
-                                isNextIdentifier({)
                                 ensureIdentifier({, expression)
                                   listener: handleIdentifier(f, expression)
                                 listener: handleNoTypeArguments(<)
@@ -76,7 +75,6 @@
                           parsePrimary([, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                               parseSend([, expression, ConstantPatternContext.none)
-                                isNextIdentifier([)
                                 ensureIdentifier([, expression)
                                   listener: handleIdentifier(f, expression)
                                 listener: handleNoTypeArguments(<)
@@ -118,7 +116,6 @@
                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                     looksLikeFunctionBody(;)
                     parseSend(=, expression, ConstantPatternContext.none)
-                      isNextIdentifier(=)
                       ensureIdentifier(=, expression)
                         listener: handleIdentifier(g, expression)
                       listener: handleNoTypeArguments(()
@@ -132,7 +129,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(f, expression)
                                         listener: handleNoTypeArguments(<)
@@ -180,7 +176,6 @@
                           parsePrimary({, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                               parseSend({, expression, ConstantPatternContext.none)
-                                isNextIdentifier({)
                                 ensureIdentifier({, expression)
                                   listener: handleIdentifier(f, expression)
                                 listener: handleNoTypeArguments(<)
@@ -234,7 +229,6 @@
                           parsePrimary([, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                               parseSend([, expression, ConstantPatternContext.none)
-                                isNextIdentifier([)
                                 ensureIdentifier([, expression)
                                   listener: handleIdentifier(f, expression)
                                 listener: handleNoTypeArguments(<)
@@ -281,7 +275,6 @@
                 parsePrimary(=, expression, ConstantPatternContext.none)
                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                     parseSend(=, expression, ConstantPatternContext.none)
-                      isNextIdentifier(=)
                       ensureIdentifier(=, expression)
                         listener: handleIdentifier(f, expression)
                       listener: handleNoTypeArguments(<)
@@ -328,7 +321,6 @@
                 parsePrimary(=, expression, ConstantPatternContext.none)
                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                     parseSend(=, expression, ConstantPatternContext.none)
-                      isNextIdentifier(=)
                       ensureIdentifier(=, expression)
                         listener: handleIdentifier(f, expression)
                       listener: handleNoTypeArguments(<)
@@ -376,7 +368,6 @@
                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                     looksLikeFunctionBody(;)
                     parseSend(=, expression, ConstantPatternContext.none)
-                      isNextIdentifier(=)
                       ensureIdentifier(=, expression)
                         listener: handleIdentifier(f, expression)
                       listener: beginTypeArguments(<)
@@ -461,7 +452,6 @@
                 parsePrimary(=, expression, ConstantPatternContext.none)
                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                     parseSend(=, expression, ConstantPatternContext.none)
-                      isNextIdentifier(=)
                       ensureIdentifier(=, expression)
                         listener: handleIdentifier(f, expression)
                       listener: handleNoTypeArguments(<)
@@ -480,7 +470,6 @@
               parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                 parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                   parseSend(., expressionContinuation, ConstantPatternContext.none)
-                    isNextIdentifier(.)
                     ensureIdentifier(., expressionContinuation)
                       listener: handleIdentifier(foo, expressionContinuation)
                     listener: beginTypeArguments(<)
@@ -519,7 +508,6 @@
                 parsePrimary(=, expression, ConstantPatternContext.none)
                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                     parseSend(=, expression, ConstantPatternContext.none)
-                      isNextIdentifier(=)
                       ensureIdentifier(=, expression)
                         listener: handleIdentifier(f, expression)
                       listener: handleNoTypeArguments(<)
@@ -538,7 +526,6 @@
               parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                 parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                   parseSend(., expressionContinuation, ConstantPatternContext.none)
-                    isNextIdentifier(.)
                     ensureIdentifier(., expressionContinuation)
                       listener: handleIdentifier(hashCode, expressionContinuation)
                     listener: handleNoTypeArguments(;)
@@ -570,7 +557,6 @@
                 parsePrimary(=, expression, ConstantPatternContext.none)
                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                     parseSend(=, expression, ConstantPatternContext.none)
-                      isNextIdentifier(=)
                       ensureIdentifier(=, expression)
                         listener: handleIdentifier(f, expression)
                       listener: handleNoTypeArguments(<)
@@ -611,7 +597,6 @@
                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                     looksLikeFunctionBody(;)
                     parseSend(=, expression, ConstantPatternContext.none)
-                      isNextIdentifier(=)
                       ensureIdentifier(=, expression)
                         listener: handleIdentifier(f, expression)
                       listener: handleNoTypeArguments(()
@@ -625,7 +610,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(a, expression)
                                         listener: handleNoTypeArguments(<)
@@ -638,7 +622,6 @@
                                     parsePrimary(<, expression, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral(<, expression, ConstantPatternContext.none)
                                         parseSend(<, expression, ConstantPatternContext.none)
-                                          isNextIdentifier(<)
                                           ensureIdentifier(<, expression)
                                             listener: handleIdentifier(b, expression)
                                           listener: handleNoTypeArguments(,)
@@ -652,7 +635,6 @@
                                   parsePrimary(,, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                       parseSend(,, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(,)
                                         ensureIdentifier(,, expression)
                                           listener: handleIdentifier(c, expression)
                                         listener: handleNoTypeArguments(>)
@@ -664,7 +646,6 @@
                                   parseUnaryExpression(>, true, ConstantPatternContext.none)
                                     parsePrimary(>, expression, ConstantPatternContext.none)
                                       parseSend(>, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(>)
                                         ensureIdentifier(>, expression)
                                           reportRecoverableErrorWithToken(&, Template(ExpectedIdentifier))
                                             listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got '&'., Try inserting an identifier before '&'., {lexeme: &}], &, &)
@@ -680,7 +661,6 @@
                                       parsePrimary(&, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral(&, expression, ConstantPatternContext.none)
                                           parseSend(&, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(&)
                                             ensureIdentifier(&, expression)
                                               listener: handleIdentifier(d, expression)
                                             listener: handleNoTypeArguments())
@@ -716,7 +696,6 @@
                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                     looksLikeFunctionBody(;)
                     parseSend(=, expression, ConstantPatternContext.none)
-                      isNextIdentifier(=)
                       ensureIdentifier(=, expression)
                         listener: handleIdentifier(f, expression)
                       listener: handleNoTypeArguments(()
@@ -730,7 +709,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(a, expression)
                                         listener: handleNoTypeArguments(<)
@@ -743,7 +721,6 @@
                                     parsePrimary(<, expression, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral(<, expression, ConstantPatternContext.none)
                                         parseSend(<, expression, ConstantPatternContext.none)
-                                          isNextIdentifier(<)
                                           ensureIdentifier(<, expression)
                                             listener: handleIdentifier(b, expression)
                                           listener: handleNoTypeArguments(,)
@@ -757,7 +734,6 @@
                                   parsePrimary(,, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                       parseSend(,, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(,)
                                         ensureIdentifier(,, expression)
                                           listener: handleIdentifier(c, expression)
                                         listener: handleNoTypeArguments(>)
@@ -771,7 +747,6 @@
                                       inPlainSync()
                                       parseSendOrFunctionLiteral(>, expression, ConstantPatternContext.none)
                                         parseSend(>, expression, ConstantPatternContext.none)
-                                          isNextIdentifier(>)
                                           ensureIdentifier(>, expression)
                                             inPlainSync()
                                             listener: handleIdentifier(as, expression)
@@ -807,7 +782,6 @@
                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                     looksLikeFunctionBody(;)
                     parseSend(=, expression, ConstantPatternContext.none)
-                      isNextIdentifier(=)
                       ensureIdentifier(=, expression)
                         listener: handleIdentifier(f, expression)
                       listener: handleNoTypeArguments(()
@@ -821,7 +795,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(a, expression)
                                         listener: handleNoTypeArguments(<)
@@ -834,7 +807,6 @@
                                     parsePrimary(<, expression, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral(<, expression, ConstantPatternContext.none)
                                         parseSend(<, expression, ConstantPatternContext.none)
-                                          isNextIdentifier(<)
                                           ensureIdentifier(<, expression)
                                             listener: handleIdentifier(b, expression)
                                           listener: handleNoTypeArguments(,)
@@ -848,7 +820,6 @@
                                   parsePrimary(,, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                       parseSend(,, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(,)
                                         ensureIdentifier(,, expression)
                                           listener: handleIdentifier(c, expression)
                                         listener: handleNoTypeArguments(>)
@@ -860,7 +831,6 @@
                                   parseUnaryExpression(>, true, ConstantPatternContext.none)
                                     parsePrimary(>, expression, ConstantPatternContext.none)
                                       parseSend(>, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(>)
                                         ensureIdentifier(>, expression)
                                           reportRecoverableErrorWithToken(*, Template(ExpectedIdentifier))
                                             listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got '*'., Try inserting an identifier before '*'., {lexeme: *}], *, *)
@@ -876,7 +846,6 @@
                                       parsePrimary(*, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral(*, expression, ConstantPatternContext.none)
                                           parseSend(*, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(*)
                                             ensureIdentifier(*, expression)
                                               listener: handleIdentifier(d, expression)
                                             listener: handleNoTypeArguments())
@@ -912,7 +881,6 @@
                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                     looksLikeFunctionBody(;)
                     parseSend(=, expression, ConstantPatternContext.none)
-                      isNextIdentifier(=)
                       ensureIdentifier(=, expression)
                         listener: handleIdentifier(f, expression)
                       listener: handleNoTypeArguments(()
@@ -926,7 +894,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(a, expression)
                                         listener: handleNoTypeArguments(<)
@@ -939,7 +906,6 @@
                                     parsePrimary(<, expression, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral(<, expression, ConstantPatternContext.none)
                                         parseSend(<, expression, ConstantPatternContext.none)
-                                          isNextIdentifier(<)
                                           ensureIdentifier(<, expression)
                                             listener: handleIdentifier(b, expression)
                                           listener: handleNoTypeArguments(,)
@@ -953,7 +919,6 @@
                                   parsePrimary(,, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                       parseSend(,, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(,)
                                         ensureIdentifier(,, expression)
                                           listener: handleIdentifier(c, expression)
                                         listener: handleNoTypeArguments(>)
@@ -974,7 +939,6 @@
                                                   parsePrimary([, expression, ConstantPatternContext.none)
                                                     parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                                       parseSend([, expression, ConstantPatternContext.none)
-                                                        isNextIdentifier([)
                                                         ensureIdentifier([, expression)
                                                           listener: handleIdentifier(d, expression)
                                                         listener: handleNoTypeArguments(])
@@ -1011,7 +975,6 @@
                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                     looksLikeFunctionBody(;)
                     parseSend(=, expression, ConstantPatternContext.none)
-                      isNextIdentifier(=)
                       ensureIdentifier(=, expression)
                         listener: handleIdentifier(f, expression)
                       listener: handleNoTypeArguments(()
@@ -1025,7 +988,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(a, expression)
                                         listener: handleNoTypeArguments(<)
@@ -1038,7 +1000,6 @@
                                     parsePrimary(<, expression, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral(<, expression, ConstantPatternContext.none)
                                         parseSend(<, expression, ConstantPatternContext.none)
-                                          isNextIdentifier(<)
                                           ensureIdentifier(<, expression)
                                             listener: handleIdentifier(b, expression)
                                           listener: handleNoTypeArguments(,)
@@ -1052,7 +1013,6 @@
                                   parsePrimary(,, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                       parseSend(,, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(,)
                                         ensureIdentifier(,, expression)
                                           listener: handleIdentifier(c, expression)
                                         listener: handleNoTypeArguments(>)
@@ -1074,7 +1034,6 @@
                                                     parsePrimary((, expression, ConstantPatternContext.none)
                                                       parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                         parseSend((, expression, ConstantPatternContext.none)
-                                                          isNextIdentifier(()
                                                           ensureIdentifier((, expression)
                                                             listener: handleIdentifier(d, expression)
                                                           listener: handleNoTypeArguments())
@@ -1112,7 +1071,6 @@
                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                     looksLikeFunctionBody(;)
                     parseSend(=, expression, ConstantPatternContext.none)
-                      isNextIdentifier(=)
                       ensureIdentifier(=, expression)
                         listener: handleIdentifier(f, expression)
                       listener: handleNoTypeArguments(()
@@ -1126,7 +1084,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(a, expression)
                                         listener: handleNoTypeArguments(<)
@@ -1139,7 +1096,6 @@
                                     parsePrimary(<, expression, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral(<, expression, ConstantPatternContext.none)
                                         parseSend(<, expression, ConstantPatternContext.none)
-                                          isNextIdentifier(<)
                                           ensureIdentifier(<, expression)
                                             listener: handleIdentifier(b, expression)
                                           listener: handleNoTypeArguments(,)
@@ -1153,7 +1109,6 @@
                                   parsePrimary(,, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                       parseSend(,, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(,)
                                         ensureIdentifier(,, expression)
                                           listener: handleIdentifier(c, expression)
                                         listener: handleNoTypeArguments(>)
@@ -1165,7 +1120,6 @@
                                   parseUnaryExpression(>, true, ConstantPatternContext.none)
                                     parsePrimary(>, expression, ConstantPatternContext.none)
                                       parseSend(>, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(>)
                                         ensureIdentifier(>, expression)
                                           reportRecoverableErrorWithToken(|, Template(ExpectedIdentifier))
                                             listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got '|'., Try inserting an identifier before '|'., {lexeme: |}], |, |)
@@ -1181,7 +1135,6 @@
                                       parsePrimary(|, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral(|, expression, ConstantPatternContext.none)
                                           parseSend(|, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(|)
                                             ensureIdentifier(|, expression)
                                               listener: handleIdentifier(d, expression)
                                             listener: handleNoTypeArguments())
@@ -1217,7 +1170,6 @@
                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                     looksLikeFunctionBody(;)
                     parseSend(=, expression, ConstantPatternContext.none)
-                      isNextIdentifier(=)
                       ensureIdentifier(=, expression)
                         listener: handleIdentifier(f, expression)
                       listener: handleNoTypeArguments(()
@@ -1231,7 +1183,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(a, expression)
                                         listener: handleNoTypeArguments(<)
@@ -1244,7 +1195,6 @@
                                     parsePrimary(<, expression, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral(<, expression, ConstantPatternContext.none)
                                         parseSend(<, expression, ConstantPatternContext.none)
-                                          isNextIdentifier(<)
                                           ensureIdentifier(<, expression)
                                             listener: handleIdentifier(b, expression)
                                           listener: handleNoTypeArguments(,)
@@ -1258,7 +1208,6 @@
                                   parsePrimary(,, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                       parseSend(,, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(,)
                                         ensureIdentifier(,, expression)
                                           listener: handleIdentifier(c, expression)
                                         listener: handleNoTypeArguments(>)
@@ -1270,7 +1219,6 @@
                                   parseUnaryExpression(>, true, ConstantPatternContext.none)
                                     parsePrimary(>, expression, ConstantPatternContext.none)
                                       parseSend(>, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(>)
                                         ensureIdentifier(>, expression)
                                           reportRecoverableErrorWithToken(^, Template(ExpectedIdentifier))
                                             listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got '^'., Try inserting an identifier before '^'., {lexeme: ^}], ^, ^)
@@ -1286,7 +1234,6 @@
                                       parsePrimary(^, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral(^, expression, ConstantPatternContext.none)
                                           parseSend(^, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(^)
                                             ensureIdentifier(^, expression)
                                               listener: handleIdentifier(d, expression)
                                             listener: handleNoTypeArguments())
@@ -1322,7 +1269,6 @@
                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                     looksLikeFunctionBody(;)
                     parseSend(=, expression, ConstantPatternContext.none)
-                      isNextIdentifier(=)
                       ensureIdentifier(=, expression)
                         listener: handleIdentifier(f, expression)
                       listener: handleNoTypeArguments(()
@@ -1336,7 +1282,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(a, expression)
                                         listener: handleNoTypeArguments(<)
@@ -1349,7 +1294,6 @@
                                     parsePrimary(<, expression, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral(<, expression, ConstantPatternContext.none)
                                         parseSend(<, expression, ConstantPatternContext.none)
-                                          isNextIdentifier(<)
                                           ensureIdentifier(<, expression)
                                             listener: handleIdentifier(b, expression)
                                           listener: handleNoTypeArguments(,)
@@ -1363,7 +1307,6 @@
                                   parsePrimary(,, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                       parseSend(,, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(,)
                                         ensureIdentifier(,, expression)
                                           listener: handleIdentifier(c, expression)
                                         listener: handleNoTypeArguments(>)
@@ -1376,7 +1319,6 @@
                                     parsePrimary(>, expression, ConstantPatternContext.none)
                                       inPlainSync()
                                       parseSend(>, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(>)
                                         ensureIdentifier(>, expression)
                                           reportRecoverableErrorWithToken(is, Template(ExpectedIdentifier))
                                             listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got 'is'., Try inserting an identifier before 'is'., {lexeme: is}], is, is)
@@ -1422,7 +1364,6 @@
                 parsePrimary(=, expression, ConstantPatternContext.none)
                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                     parseSend(=, expression, ConstantPatternContext.none)
-                      isNextIdentifier(=)
                       ensureIdentifier(=, expression)
                         listener: handleIdentifier(f, expression)
                       listener: handleNoTypeArguments(<)
@@ -1435,7 +1376,6 @@
                   parsePrimary(<, expression, ConstantPatternContext.none)
                     parseSendOrFunctionLiteral(<, expression, ConstantPatternContext.none)
                       parseSend(<, expression, ConstantPatternContext.none)
-                        isNextIdentifier(<)
                         ensureIdentifier(<, expression)
                           listener: handleIdentifier(a, expression)
                         listener: handleNoTypeArguments(>)
@@ -1489,7 +1429,6 @@
                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                     looksLikeFunctionBody(;)
                     parseSend(=, expression, ConstantPatternContext.none)
-                      isNextIdentifier(=)
                       ensureIdentifier(=, expression)
                         listener: handleIdentifier(f, expression)
                       listener: handleNoTypeArguments(()
@@ -1503,7 +1442,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(a, expression)
                                         listener: handleNoTypeArguments(<)
@@ -1516,7 +1454,6 @@
                                     parsePrimary(<, expression, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral(<, expression, ConstantPatternContext.none)
                                         parseSend(<, expression, ConstantPatternContext.none)
-                                          isNextIdentifier(<)
                                           ensureIdentifier(<, expression)
                                             listener: handleIdentifier(b, expression)
                                           listener: handleNoTypeArguments(,)
@@ -1530,7 +1467,6 @@
                                   parsePrimary(,, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                       parseSend(,, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(,)
                                         ensureIdentifier(,, expression)
                                           listener: handleIdentifier(c, expression)
                                         listener: handleNoTypeArguments(>)
@@ -1545,7 +1481,6 @@
                                         parsePrimary(-, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral(-, expression, ConstantPatternContext.none)
                                             parseSend(-, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(-)
                                               ensureIdentifier(-, expression)
                                                 listener: handleIdentifier(d, expression)
                                               listener: handleNoTypeArguments())
@@ -1581,7 +1516,6 @@
                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                     looksLikeFunctionBody(;)
                     parseSend(=, expression, ConstantPatternContext.none)
-                      isNextIdentifier(=)
                       ensureIdentifier(=, expression)
                         listener: handleIdentifier(f, expression)
                       listener: handleNoTypeArguments(()
@@ -1595,7 +1529,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(a, expression)
                                         listener: handleNoTypeArguments(<)
@@ -1608,7 +1541,6 @@
                                     parsePrimary(<, expression, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral(<, expression, ConstantPatternContext.none)
                                         parseSend(<, expression, ConstantPatternContext.none)
-                                          isNextIdentifier(<)
                                           ensureIdentifier(<, expression)
                                             listener: handleIdentifier(b, expression)
                                           listener: handleNoTypeArguments(,)
@@ -1622,7 +1554,6 @@
                                   parsePrimary(,, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                       parseSend(,, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(,)
                                         ensureIdentifier(,, expression)
                                           listener: handleIdentifier(c, expression)
                                         listener: handleNoTypeArguments(>)
@@ -1641,7 +1572,6 @@
                                               parsePrimary([, expression, ConstantPatternContext.none)
                                                 parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                                   parseSend([, expression, ConstantPatternContext.none)
-                                                    isNextIdentifier([)
                                                     ensureIdentifier([, expression)
                                                       listener: handleIdentifier(d, expression)
                                                     listener: handleNoTypeArguments(])
@@ -1677,7 +1607,6 @@
                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                     looksLikeFunctionBody(;)
                     parseSend(=, expression, ConstantPatternContext.none)
-                      isNextIdentifier(=)
                       ensureIdentifier(=, expression)
                         listener: handleIdentifier(f, expression)
                       listener: handleNoTypeArguments(()
@@ -1691,7 +1620,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(a, expression)
                                         listener: handleNoTypeArguments(<)
@@ -1704,7 +1632,6 @@
                                     parsePrimary(<, expression, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral(<, expression, ConstantPatternContext.none)
                                         parseSend(<, expression, ConstantPatternContext.none)
-                                          isNextIdentifier(<)
                                           ensureIdentifier(<, expression)
                                             listener: handleIdentifier(b, expression)
                                           listener: handleNoTypeArguments(,)
@@ -1718,7 +1645,6 @@
                                   parsePrimary(,, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                       parseSend(,, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(,)
                                         ensureIdentifier(,, expression)
                                           listener: handleIdentifier(c, expression)
                                         listener: handleNoTypeArguments(>)
@@ -1737,7 +1663,6 @@
                                               parsePrimary([, expression, ConstantPatternContext.none)
                                                 parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                                   parseSend([, expression, ConstantPatternContext.none)
-                                                    isNextIdentifier([)
                                                     ensureIdentifier([, expression)
                                                       listener: handleIdentifier(d, expression)
                                                     listener: handleNoTypeArguments(])
@@ -1754,7 +1679,6 @@
                                     parsePrimary(>, expression, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral(>, expression, ConstantPatternContext.none)
                                         parseSend(>, expression, ConstantPatternContext.none)
-                                          isNextIdentifier(>)
                                           ensureIdentifier(>, expression)
                                             listener: handleIdentifier(e, expression)
                                           listener: handleNoTypeArguments())
@@ -1789,7 +1713,6 @@
                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                     looksLikeFunctionBody(;)
                     parseSend(=, expression, ConstantPatternContext.none)
-                      isNextIdentifier(=)
                       ensureIdentifier(=, expression)
                         listener: handleIdentifier(f, expression)
                       listener: handleNoTypeArguments(()
@@ -1803,7 +1726,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(a, expression)
                                         listener: handleNoTypeArguments(<)
@@ -1816,7 +1738,6 @@
                                     parsePrimary(<, expression, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral(<, expression, ConstantPatternContext.none)
                                         parseSend(<, expression, ConstantPatternContext.none)
-                                          isNextIdentifier(<)
                                           ensureIdentifier(<, expression)
                                             listener: handleIdentifier(b, expression)
                                           listener: handleNoTypeArguments(,)
@@ -1830,7 +1751,6 @@
                                   parsePrimary(,, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                       parseSend(,, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(,)
                                         ensureIdentifier(,, expression)
                                           listener: handleIdentifier(c, expression)
                                         listener: handleNoTypeArguments(>)
@@ -1849,7 +1769,6 @@
                                               parsePrimary([, expression, ConstantPatternContext.none)
                                                 parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                                   parseSend([, expression, ConstantPatternContext.none)
-                                                    isNextIdentifier([)
                                                     ensureIdentifier([, expression)
                                                       listener: handleIdentifier(d, expression)
                                                     listener: handleNoTypeArguments(,)
@@ -1862,7 +1781,6 @@
                                               parsePrimary(,, expression, ConstantPatternContext.none)
                                                 parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                                   parseSend(,, expression, ConstantPatternContext.none)
-                                                    isNextIdentifier(,)
                                                     ensureIdentifier(,, expression)
                                                       listener: handleIdentifier(e, expression)
                                                     listener: handleNoTypeArguments(])
@@ -1898,7 +1816,6 @@
                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                     looksLikeFunctionBody(;)
                     parseSend(=, expression, ConstantPatternContext.none)
-                      isNextIdentifier(=)
                       ensureIdentifier(=, expression)
                         listener: handleIdentifier(f, expression)
                       listener: handleNoTypeArguments(()
@@ -1912,7 +1829,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(a, expression)
                                         listener: handleNoTypeArguments(<)
@@ -1925,7 +1841,6 @@
                                     parsePrimary(<, expression, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral(<, expression, ConstantPatternContext.none)
                                         parseSend(<, expression, ConstantPatternContext.none)
-                                          isNextIdentifier(<)
                                           ensureIdentifier(<, expression)
                                             listener: handleIdentifier(b, expression)
                                           listener: handleNoTypeArguments(,)
@@ -1939,7 +1854,6 @@
                                   parsePrimary(,, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                       parseSend(,, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(,)
                                         ensureIdentifier(,, expression)
                                           listener: handleIdentifier(c, expression)
                                         listener: handleNoTypeArguments(>)
@@ -1951,7 +1865,6 @@
                                   parseUnaryExpression(>, true, ConstantPatternContext.none)
                                     parsePrimary(>, expression, ConstantPatternContext.none)
                                       parseSend(>, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(>)
                                         ensureIdentifier(>, expression)
                                           reportRecoverableErrorWithToken(%, Template(ExpectedIdentifier))
                                             listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got '%'., Try inserting an identifier before '%'., {lexeme: %}], %, %)
@@ -1967,7 +1880,6 @@
                                       parsePrimary(%, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral(%, expression, ConstantPatternContext.none)
                                           parseSend(%, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(%)
                                             ensureIdentifier(%, expression)
                                               listener: handleIdentifier(d, expression)
                                             listener: handleNoTypeArguments())
@@ -2003,7 +1915,6 @@
                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                     looksLikeFunctionBody(;)
                     parseSend(=, expression, ConstantPatternContext.none)
-                      isNextIdentifier(=)
                       ensureIdentifier(=, expression)
                         listener: handleIdentifier(f, expression)
                       listener: handleNoTypeArguments(()
@@ -2017,7 +1928,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(a, expression)
                                         listener: handleNoTypeArguments(<)
@@ -2030,7 +1940,6 @@
                                     parsePrimary(<, expression, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral(<, expression, ConstantPatternContext.none)
                                         parseSend(<, expression, ConstantPatternContext.none)
-                                          isNextIdentifier(<)
                                           ensureIdentifier(<, expression)
                                             listener: handleIdentifier(b, expression)
                                           listener: handleNoTypeArguments(,)
@@ -2044,7 +1953,6 @@
                                   parsePrimary(,, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                       parseSend(,, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(,)
                                         ensureIdentifier(,, expression)
                                           listener: handleIdentifier(c, expression)
                                         listener: handleNoTypeArguments(>)
@@ -2056,7 +1964,6 @@
                                   parseUnaryExpression(>, true, ConstantPatternContext.none)
                                     parsePrimary(>, expression, ConstantPatternContext.none)
                                       parseSend(>, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(>)
                                         ensureIdentifier(>, expression)
                                           reportRecoverableErrorWithToken(.., Template(ExpectedIdentifier))
                                             listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got '..'., Try inserting an identifier before '..'., {lexeme: ..}], .., ..)
@@ -2070,7 +1977,6 @@
                                 parseCascadeExpression()
                                   listener: beginCascade(..)
                                   parseSend(.., expressionContinuation, ConstantPatternContext.none)
-                                    isNextIdentifier(..)
                                     ensureIdentifier(.., expressionContinuation)
                                       listener: handleIdentifier(toString, expressionContinuation)
                                     listener: handleNoTypeArguments(()
@@ -2110,7 +2016,6 @@
                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                     looksLikeFunctionBody(;)
                     parseSend(=, expression, ConstantPatternContext.none)
-                      isNextIdentifier(=)
                       ensureIdentifier(=, expression)
                         listener: handleIdentifier(f, expression)
                       listener: handleNoTypeArguments(()
@@ -2124,7 +2029,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(a, expression)
                                         listener: handleNoTypeArguments(<)
@@ -2137,7 +2041,6 @@
                                     parsePrimary(<, expression, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral(<, expression, ConstantPatternContext.none)
                                         parseSend(<, expression, ConstantPatternContext.none)
-                                          isNextIdentifier(<)
                                           ensureIdentifier(<, expression)
                                             listener: handleIdentifier(b, expression)
                                           listener: handleNoTypeArguments(,)
@@ -2151,7 +2054,6 @@
                                   parsePrimary(,, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                       parseSend(,, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(,)
                                         ensureIdentifier(,, expression)
                                           listener: handleIdentifier(c, expression)
                                         listener: handleNoTypeArguments(>)
@@ -2168,7 +2070,6 @@
                                     parsePrimary(>, expression, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral(>, expression, ConstantPatternContext.none)
                                         parseSend(>, expression, ConstantPatternContext.none)
-                                          isNextIdentifier(>)
                                           ensureIdentifier(>, expression)
                                             listener: handleIdentifier(, expression)
                                           listener: handleNoTypeArguments(+)
@@ -2181,7 +2082,6 @@
                                       parsePrimary(+, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral(+, expression, ConstantPatternContext.none)
                                           parseSend(+, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(+)
                                             ensureIdentifier(+, expression)
                                               listener: handleIdentifier(d, expression)
                                             listener: handleNoTypeArguments())
@@ -2217,7 +2117,6 @@
                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                     looksLikeFunctionBody(;)
                     parseSend(=, expression, ConstantPatternContext.none)
-                      isNextIdentifier(=)
                       ensureIdentifier(=, expression)
                         listener: handleIdentifier(f, expression)
                       listener: handleNoTypeArguments(()
@@ -2231,7 +2130,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(a, expression)
                                         listener: handleNoTypeArguments(<)
@@ -2244,7 +2142,6 @@
                                     parsePrimary(<, expression, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral(<, expression, ConstantPatternContext.none)
                                         parseSend(<, expression, ConstantPatternContext.none)
-                                          isNextIdentifier(<)
                                           ensureIdentifier(<, expression)
                                             listener: handleIdentifier(b, expression)
                                           listener: handleNoTypeArguments(,)
@@ -2258,7 +2155,6 @@
                                   parsePrimary(,, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                       parseSend(,, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(,)
                                         ensureIdentifier(,, expression)
                                           listener: handleIdentifier(c, expression)
                                         listener: handleNoTypeArguments(>)
@@ -2270,7 +2166,6 @@
                                   parseUnaryExpression(>, true, ConstantPatternContext.none)
                                     parsePrimary(>, expression, ConstantPatternContext.none)
                                       parseSend(>, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(>)
                                         ensureIdentifier(>, expression)
                                           reportRecoverableErrorWithToken(?, Template(ExpectedIdentifier))
                                             listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got '?'., Try inserting an identifier before '?'., {lexeme: ?}], ?, ?)
@@ -2325,7 +2220,6 @@
                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                     looksLikeFunctionBody(;)
                     parseSend(=, expression, ConstantPatternContext.none)
-                      isNextIdentifier(=)
                       ensureIdentifier(=, expression)
                         listener: handleIdentifier(f, expression)
                       listener: handleNoTypeArguments(()
@@ -2339,7 +2233,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(a, expression)
                                         listener: handleNoTypeArguments(<)
@@ -2352,7 +2245,6 @@
                                     parsePrimary(<, expression, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral(<, expression, ConstantPatternContext.none)
                                         parseSend(<, expression, ConstantPatternContext.none)
-                                          isNextIdentifier(<)
                                           ensureIdentifier(<, expression)
                                             listener: handleIdentifier(b, expression)
                                           listener: handleNoTypeArguments(,)
@@ -2366,7 +2258,6 @@
                                   parsePrimary(,, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                       parseSend(,, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(,)
                                         ensureIdentifier(,, expression)
                                           listener: handleIdentifier(c, expression)
                                         listener: handleNoTypeArguments(>)
@@ -2378,7 +2269,6 @@
                                   parseUnaryExpression(>, true, ConstantPatternContext.none)
                                     parsePrimary(>, expression, ConstantPatternContext.none)
                                       parseSend(>, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(>)
                                         ensureIdentifier(>, expression)
                                           reportRecoverableErrorWithToken(?., Template(ExpectedIdentifier))
                                             listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got '?.'., Try inserting an identifier before '?.'., {lexeme: ?.}], ?., ?.)
@@ -2391,7 +2281,6 @@
                                   parsePrimary(?., expressionContinuation, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(?., expressionContinuation, ConstantPatternContext.none)
                                       parseSend(?., expressionContinuation, ConstantPatternContext.none)
-                                        isNextIdentifier(?.)
                                         ensureIdentifier(?., expressionContinuation)
                                           listener: handleIdentifier(toString, expressionContinuation)
                                         listener: handleNoTypeArguments(()
@@ -2430,7 +2319,6 @@
                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                     looksLikeFunctionBody(;)
                     parseSend(=, expression, ConstantPatternContext.none)
-                      isNextIdentifier(=)
                       ensureIdentifier(=, expression)
                         listener: handleIdentifier(f, expression)
                       listener: handleNoTypeArguments(()
@@ -2444,7 +2332,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(a, expression)
                                         listener: handleNoTypeArguments(<)
@@ -2457,7 +2344,6 @@
                                     parsePrimary(<, expression, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral(<, expression, ConstantPatternContext.none)
                                         parseSend(<, expression, ConstantPatternContext.none)
-                                          isNextIdentifier(<)
                                           ensureIdentifier(<, expression)
                                             listener: handleIdentifier(b, expression)
                                           listener: handleNoTypeArguments(,)
@@ -2471,7 +2357,6 @@
                                   parsePrimary(,, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                       parseSend(,, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(,)
                                         ensureIdentifier(,, expression)
                                           listener: handleIdentifier(c, expression)
                                         listener: handleNoTypeArguments(>)
@@ -2483,7 +2368,6 @@
                                   parseUnaryExpression(>, true, ConstantPatternContext.none)
                                     parsePrimary(>, expression, ConstantPatternContext.none)
                                       parseSend(>, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(>)
                                         ensureIdentifier(>, expression)
                                           reportRecoverableErrorWithToken(?., Template(ExpectedIdentifier))
                                             listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got '?.'., Try inserting an identifier before '?.'., {lexeme: ?.}], ?., ?.)
@@ -2496,7 +2380,6 @@
                                   parsePrimary(?., expressionContinuation, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(?., expressionContinuation, ConstantPatternContext.none)
                                       parseSend(?., expressionContinuation, ConstantPatternContext.none)
-                                        isNextIdentifier(?.)
                                         ensureIdentifier(?., expressionContinuation)
                                           listener: handleIdentifier(foo, expressionContinuation)
                                         listener: beginTypeArguments(<)
@@ -2539,7 +2422,6 @@
                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                     looksLikeFunctionBody(;)
                     parseSend(=, expression, ConstantPatternContext.none)
-                      isNextIdentifier(=)
                       ensureIdentifier(=, expression)
                         listener: handleIdentifier(f, expression)
                       listener: handleNoTypeArguments(()
@@ -2553,7 +2435,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(a, expression)
                                         listener: handleNoTypeArguments(<)
@@ -2566,7 +2447,6 @@
                                     parsePrimary(<, expression, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral(<, expression, ConstantPatternContext.none)
                                         parseSend(<, expression, ConstantPatternContext.none)
-                                          isNextIdentifier(<)
                                           ensureIdentifier(<, expression)
                                             listener: handleIdentifier(b, expression)
                                           listener: handleNoTypeArguments(,)
@@ -2580,7 +2460,6 @@
                                   parsePrimary(,, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                       parseSend(,, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(,)
                                         ensureIdentifier(,, expression)
                                           listener: handleIdentifier(c, expression)
                                         listener: handleNoTypeArguments(>)
@@ -2592,7 +2471,6 @@
                                   parseUnaryExpression(>, true, ConstantPatternContext.none)
                                     parsePrimary(>, expression, ConstantPatternContext.none)
                                       parseSend(>, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(>)
                                         ensureIdentifier(>, expression)
                                           reportRecoverableErrorWithToken(?.., Template(ExpectedIdentifier))
                                             listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got '?..'., Try inserting an identifier before '?..'., {lexeme: ?..}], ?.., ?..)
@@ -2614,7 +2492,6 @@
                                     parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                       looksLikeFunctionBody())
                                       parseSend(,, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(,)
                                         ensureIdentifier(,, expression)
                                           listener: handleIdentifier(toString, expression)
                                         listener: handleNoTypeArguments(()
@@ -2651,7 +2528,6 @@
                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                     looksLikeFunctionBody(;)
                     parseSend(=, expression, ConstantPatternContext.none)
-                      isNextIdentifier(=)
                       ensureIdentifier(=, expression)
                         listener: handleIdentifier(f, expression)
                       listener: handleNoTypeArguments(()
@@ -2665,7 +2541,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(a, expression)
                                         listener: handleNoTypeArguments(<)
@@ -2678,7 +2553,6 @@
                                     parsePrimary(<, expression, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral(<, expression, ConstantPatternContext.none)
                                         parseSend(<, expression, ConstantPatternContext.none)
-                                          isNextIdentifier(<)
                                           ensureIdentifier(<, expression)
                                             listener: handleIdentifier(b, expression)
                                           listener: handleNoTypeArguments(,)
@@ -2692,7 +2566,6 @@
                                   parsePrimary(,, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                       parseSend(,, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(,)
                                         ensureIdentifier(,, expression)
                                           listener: handleIdentifier(c, expression)
                                         listener: handleNoTypeArguments(>)
@@ -2704,7 +2577,6 @@
                                   parseUnaryExpression(>, true, ConstantPatternContext.none)
                                     parsePrimary(>, expression, ConstantPatternContext.none)
                                       parseSend(>, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(>)
                                         ensureIdentifier(>, expression)
                                           reportRecoverableErrorWithToken(?., Template(ExpectedIdentifier))
                                             listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got '?.'., Try inserting an identifier before '?.'., {lexeme: ?.}], ?., ?.)
@@ -2717,7 +2589,6 @@
                                   parsePrimary(?., expressionContinuation, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(?., expressionContinuation, ConstantPatternContext.none)
                                       parseSend(?., expressionContinuation, ConstantPatternContext.none)
-                                        isNextIdentifier(?.)
                                         ensureIdentifier(?., expressionContinuation)
                                           listener: handleIdentifier(hashCode, expressionContinuation)
                                         listener: handleNoTypeArguments())
@@ -2753,7 +2624,6 @@
                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                     looksLikeFunctionBody(;)
                     parseSend(=, expression, ConstantPatternContext.none)
-                      isNextIdentifier(=)
                       ensureIdentifier(=, expression)
                         listener: handleIdentifier(f, expression)
                       listener: handleNoTypeArguments(()
@@ -2767,7 +2637,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(a, expression)
                                         listener: handleNoTypeArguments(<)
@@ -2780,7 +2649,6 @@
                                     parsePrimary(<, expression, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral(<, expression, ConstantPatternContext.none)
                                         parseSend(<, expression, ConstantPatternContext.none)
-                                          isNextIdentifier(<)
                                           ensureIdentifier(<, expression)
                                             listener: handleIdentifier(b, expression)
                                           listener: handleNoTypeArguments(,)
@@ -2794,7 +2662,6 @@
                                   parsePrimary(,, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                       parseSend(,, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(,)
                                         ensureIdentifier(,, expression)
                                           listener: handleIdentifier(c, expression)
                                         listener: handleNoTypeArguments(>)
@@ -2806,7 +2673,6 @@
                                   parseUnaryExpression(>, true, ConstantPatternContext.none)
                                     parsePrimary(>, expression, ConstantPatternContext.none)
                                       parseSend(>, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(>)
                                         ensureIdentifier(>, expression)
                                           reportRecoverableErrorWithToken(??, Template(ExpectedIdentifier))
                                             listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got '??'., Try inserting an identifier before '??'., {lexeme: ??}], ??, ??)
@@ -2823,7 +2689,6 @@
                                     parsePrimary(??, expression, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral(??, expression, ConstantPatternContext.none)
                                         parseSend(??, expression, ConstantPatternContext.none)
-                                          isNextIdentifier(??)
                                           ensureIdentifier(??, expression)
                                             listener: handleIdentifier(d, expression)
                                           listener: handleNoTypeArguments())
@@ -2858,7 +2723,6 @@
                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                     looksLikeFunctionBody(;)
                     parseSend(=, expression, ConstantPatternContext.none)
-                      isNextIdentifier(=)
                       ensureIdentifier(=, expression)
                         listener: handleIdentifier(f, expression)
                       listener: handleNoTypeArguments(()
@@ -2872,7 +2736,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(a, expression)
                                         listener: handleNoTypeArguments(<)
@@ -2885,7 +2748,6 @@
                                     parsePrimary(<, expression, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral(<, expression, ConstantPatternContext.none)
                                         parseSend(<, expression, ConstantPatternContext.none)
-                                          isNextIdentifier(<)
                                           ensureIdentifier(<, expression)
                                             listener: handleIdentifier(b, expression)
                                           listener: handleNoTypeArguments(,)
@@ -2899,7 +2761,6 @@
                                   parsePrimary(,, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                       parseSend(,, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(,)
                                         ensureIdentifier(,, expression)
                                           listener: handleIdentifier(c, expression)
                                         listener: handleNoTypeArguments(>)
@@ -2911,7 +2772,6 @@
                                   parseUnaryExpression(>, true, ConstantPatternContext.none)
                                     parsePrimary(>, expression, ConstantPatternContext.none)
                                       parseSend(>, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(>)
                                         ensureIdentifier(>, expression)
                                           reportRecoverableErrorWithToken(/, Template(ExpectedIdentifier))
                                             listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got '/'., Try inserting an identifier before '/'., {lexeme: /}], /, /)
@@ -2927,7 +2787,6 @@
                                       parsePrimary(/, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral(/, expression, ConstantPatternContext.none)
                                           parseSend(/, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(/)
                                             ensureIdentifier(/, expression)
                                               listener: handleIdentifier(d, expression)
                                             listener: handleNoTypeArguments())
@@ -2963,7 +2822,6 @@
                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                     looksLikeFunctionBody(;)
                     parseSend(=, expression, ConstantPatternContext.none)
-                      isNextIdentifier(=)
                       ensureIdentifier(=, expression)
                         listener: handleIdentifier(f, expression)
                       listener: handleNoTypeArguments(()
@@ -2977,7 +2835,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(a, expression)
                                         listener: handleNoTypeArguments(<)
@@ -2990,7 +2847,6 @@
                                     parsePrimary(<, expression, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral(<, expression, ConstantPatternContext.none)
                                         parseSend(<, expression, ConstantPatternContext.none)
-                                          isNextIdentifier(<)
                                           ensureIdentifier(<, expression)
                                             listener: handleIdentifier(b, expression)
                                           listener: handleNoTypeArguments(,)
@@ -3004,7 +2860,6 @@
                                   parsePrimary(,, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                       parseSend(,, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(,)
                                         ensureIdentifier(,, expression)
                                           listener: handleIdentifier(c, expression)
                                         listener: handleNoTypeArguments(>)
@@ -3016,7 +2871,6 @@
                                   parseUnaryExpression(>, true, ConstantPatternContext.none)
                                     parsePrimary(>, expression, ConstantPatternContext.none)
                                       parseSend(>, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(>)
                                         ensureIdentifier(>, expression)
                                           reportRecoverableErrorWithToken(~/, Template(ExpectedIdentifier))
                                             listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got '~/'., Try inserting an identifier before '~/'., {lexeme: ~/}], ~/, ~/)
@@ -3032,7 +2886,6 @@
                                       parsePrimary(~/, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral(~/, expression, ConstantPatternContext.none)
                                           parseSend(~/, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(~/)
                                             ensureIdentifier(~/, expression)
                                               listener: handleIdentifier(d, expression)
                                             listener: handleNoTypeArguments())
diff --git a/pkg/front_end/parser_testcases/general/function_reference_kinds.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/function_reference_kinds.dart.intertwined.expect
index 771a7db..a263de6 100644
--- a/pkg/front_end/parser_testcases/general/function_reference_kinds.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/function_reference_kinds.dart.intertwined.expect
@@ -23,7 +23,6 @@
                 parsePrimary(=, expression, ConstantPatternContext.none)
                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                     parseSend(=, expression, ConstantPatternContext.none)
-                      isNextIdentifier(=)
                       ensureIdentifier(=, expression)
                         listener: handleIdentifier(f, expression)
                       listener: handleNoTypeArguments(<)
@@ -64,7 +63,6 @@
                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                     looksLikeFunctionBody(.)
                     parseSend(=, expression, ConstantPatternContext.none)
-                      isNextIdentifier(=)
                       ensureIdentifier(=, expression)
                         listener: handleIdentifier(f, expression)
                       listener: handleNoTypeArguments(()
@@ -77,7 +75,6 @@
               parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                 parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                   parseSend(., expressionContinuation, ConstantPatternContext.none)
-                    isNextIdentifier(.)
                     ensureIdentifier(., expressionContinuation)
                       listener: handleIdentifier(m, expressionContinuation)
                     listener: handleNoTypeArguments(<)
@@ -118,7 +115,6 @@
                 parsePrimary(=, expression, ConstantPatternContext.none)
                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                     parseSend(=, expression, ConstantPatternContext.none)
-                      isNextIdentifier(=)
                       ensureIdentifier(=, expression)
                         listener: handleIdentifier(prefix, expression)
                       listener: handleNoTypeArguments(.)
@@ -128,7 +124,6 @@
               parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                 parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                   parseSend(., expressionContinuation, ConstantPatternContext.none)
-                    isNextIdentifier(.)
                     ensureIdentifier(., expressionContinuation)
                       listener: handleIdentifier(f, expressionContinuation)
                     listener: handleNoTypeArguments(<)
@@ -169,7 +164,6 @@
                 parsePrimary(=, expression, ConstantPatternContext.none)
                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                     parseSend(=, expression, ConstantPatternContext.none)
-                      isNextIdentifier(=)
                       ensureIdentifier(=, expression)
                         listener: handleIdentifier(prefix, expression)
                       listener: handleNoTypeArguments(.)
@@ -179,7 +173,6 @@
               parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                 parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                   parseSend(., expressionContinuation, ConstantPatternContext.none)
-                    isNextIdentifier(.)
                     ensureIdentifier(., expressionContinuation)
                       listener: handleIdentifier(ClassName, expressionContinuation)
                     listener: handleNoTypeArguments(.)
@@ -190,7 +183,6 @@
               parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                 parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                   parseSend(., expressionContinuation, ConstantPatternContext.none)
-                    isNextIdentifier(.)
                     ensureIdentifier(., expressionContinuation)
                       listener: handleIdentifier(m, expressionContinuation)
                     listener: handleNoTypeArguments(<)
diff --git a/pkg/front_end/parser_testcases/general/generic_function_typedef.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/generic_function_typedef.dart.intertwined.expect
index b070195..706d42a 100644
--- a/pkg/front_end/parser_testcases/general/generic_function_typedef.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/generic_function_typedef.dart.intertwined.expect
@@ -1394,7 +1394,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/general/issue_18090.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/issue_18090.dart.intertwined.expect
index 7912e4d..3867642 100644
--- a/pkg/front_end/parser_testcases/general/issue_18090.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/issue_18090.dart.intertwined.expect
Binary files differ
diff --git a/pkg/front_end/parser_testcases/general/issue_41121.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/issue_41121.dart.intertwined.expect
index 5bb213f..fd1a0b6 100644
--- a/pkg/front_end/parser_testcases/general/issue_41121.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/issue_41121.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(ConfigurationService, DeclarationKind.Class, ConfigurationService)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, Configuration)
+            notEofOrType(CLOSE_CURLY_BRACKET, Configuration)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, ConfigurationService)
               parseMetadataStar({)
                 listener: beginMetadataStar(Configuration)
@@ -42,7 +42,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, Configuration, ;)
               listener: endMember()
-            notEofOrValue(}, ConfigurationService)
+            notEofOrType(CLOSE_CURLY_BRACKET, ConfigurationService)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, ConfigurationService)
               parseMetadataStar(;)
                 listener: beginMetadataStar(ConfigurationService)
@@ -87,7 +87,6 @@
                               parsePrimary((, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                   parseSend((, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(()
                                     ensureIdentifier((, expression)
                                       listener: handleIdentifier(configuration, expression)
                                     listener: handleNoTypeArguments(!=)
@@ -112,7 +111,6 @@
                               parsePrimary(,, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                   parseSend(,, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(,)
                                     ensureIdentifier(,, expression)
                                       listener: handleIdentifier(_configuration, expression)
                                     listener: handleNoTypeArguments(=)
@@ -124,7 +122,6 @@
                                 parsePrimary(=, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                     parseSend(=, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(=)
                                       ensureIdentifier(=, expression)
                                         listener: handleIdentifier(configuration, expression)
                                       listener: handleNoTypeArguments({)
@@ -140,11 +137,11 @@
                 inPlainSync()
                 parseFunctionBody(configuration, false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassConstructor(null, ConfigurationService, (, :, })
               listener: endMember()
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, ConfigurationService)
               parseMetadataStar(})
                 listener: beginMetadataStar(void)
@@ -187,7 +184,6 @@
                               parsePrimary((, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                   parseSend((, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(()
                                     ensureIdentifier((, expression)
                                       listener: handleIdentifier(configuration, expression)
                                     listener: handleNoTypeArguments(!=)
@@ -212,7 +208,6 @@
                               parsePrimary(,, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                   parseSend(,, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(,)
                                     ensureIdentifier(,, expression)
                                       listener: handleIdentifier(_configuration, expression)
                                     listener: handleNoTypeArguments(=)
@@ -224,7 +219,6 @@
                                 parsePrimary(=, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                     parseSend(=, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(=)
                                       ensureIdentifier(=, expression)
                                         listener: handleIdentifier(configuration, expression)
                                       listener: handleNoTypeArguments({)
@@ -241,7 +235,7 @@
                 inPlainSync()
                 parseFunctionBody(configuration, false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 reportRecoverableError(configuration, ConstructorWithWrongName)
                   listener: handleRecoverableError(ConstructorWithWrongName, configuration, configuration)
@@ -251,7 +245,7 @@
                   listener: handleRecoverableError(ConstructorWithReturnType, void, void)
                 listener: endClassConstructor(set, void, (, :, })
               listener: endMember()
-            notEofOrValue(}, Configuration)
+            notEofOrType(CLOSE_CURLY_BRACKET, Configuration)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, ConfigurationService)
               parseMetadataStar(})
                 listener: beginMetadataStar(Configuration)
@@ -287,7 +281,6 @@
                               parsePrimary((, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                   parseSend((, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(()
                                     ensureIdentifier((, expression)
                                       listener: handleIdentifier(_configuration, expression)
                                     listener: handleNoTypeArguments(!=)
@@ -312,7 +305,6 @@
                               parsePrimary(,, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                   parseSend(,, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(,)
                                     ensureIdentifier(,, expression)
                                       listener: handleIdentifier(_configuration, expression)
                                     listener: handleNoTypeArguments(=)
@@ -324,7 +316,6 @@
                                 parsePrimary(=, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                     parseSend(=, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(=)
                                       ensureIdentifier(=, expression)
                                         listener: handleIdentifier(_configuration, expression)
                                       listener: handleNoTypeArguments(.)
@@ -334,7 +325,6 @@
                               parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                   parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                    isNextIdentifier(.)
                                     ensureIdentifier(., expressionContinuation)
                                       listener: handleIdentifier(foo, expressionContinuation)
                                     listener: handleNoTypeArguments({)
@@ -352,7 +342,7 @@
                 inPlainSync()
                 parseFunctionBody(foo, false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement({)
                     parseStatementX({)
                       parseReturnStatement({)
@@ -363,7 +353,6 @@
                               parsePrimary(return, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                                   parseSend(return, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(return)
                                     ensureIdentifier(return, expression)
                                       listener: handleIdentifier(_configuration, expression)
                                     listener: handleNoTypeArguments(;)
@@ -373,7 +362,7 @@
                         ensureSemicolon(_configuration)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 reportRecoverableError(configuration, ConstructorWithWrongName)
                   listener: handleRecoverableError(ConstructorWithWrongName, configuration, configuration)
@@ -383,7 +372,7 @@
                   listener: handleRecoverableError(ConstructorWithReturnType, Configuration, Configuration)
                 listener: endClassConstructor(get, Configuration, (, :, })
               listener: endMember()
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, ConfigurationService)
               parseMetadataStar(})
                 listener: beginMetadataStar(void)
@@ -414,7 +403,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(_configuration, expression)
                                     listener: handleNoTypeArguments(=)
@@ -435,7 +423,7 @@
                 inPlainSync()
                 parseFunctionBody(null, false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 reportRecoverableError(method, ConstructorWithWrongName)
                   listener: handleRecoverableError(ConstructorWithWrongName, method, method)
@@ -443,7 +431,7 @@
                   listener: handleRecoverableError(ConstructorWithReturnType, void, void)
                 listener: endClassConstructor(null, void, (, :, })
               listener: endMember()
-            notEofOrValue(}, Foo)
+            notEofOrType(CLOSE_CURLY_BRACKET, Foo)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, ConfigurationService)
               parseMetadataStar(})
                 listener: beginMetadataStar(Foo)
@@ -475,7 +463,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(_configuration, expression)
                                     listener: handleNoTypeArguments(=)
@@ -496,13 +483,13 @@
                 inPlainSync()
                 parseFunctionBody(null, false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 reportRecoverableError(Foo, ConstructorWithWrongName)
                   listener: handleRecoverableError(ConstructorWithWrongName, Foo, Foo)
                 listener: endClassConstructor(null, Foo, (, :, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 6, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -529,7 +516,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Configuration, DeclarationKind.Class, Configuration)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, Configuration)
+            notEofOrType(CLOSE_CURLY_BRACKET, Configuration)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Configuration)
               parseMetadataStar({)
                 listener: beginMetadataStar(Configuration)
@@ -566,7 +553,7 @@
                     inGenerator()
                 listener: endClassMethod(get, Configuration, =>, null, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/general/issue_45120.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/issue_45120.dart.intertwined.expect
index cd88f929..2d47e09 100644
--- a/pkg/front_end/parser_testcases/general/issue_45120.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/issue_45120.dart.intertwined.expect
@@ -169,7 +169,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, @)
+          notEofOrType(CLOSE_CURLY_BRACKET, @)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -292,7 +292,7 @@
                       listener: endInitializedIdentifier(f)
                     ensureSemicolon(null)
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/general/issue_45703.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/issue_45703.dart.intertwined.expect
index 77dc8c3..4e867f5 100644
--- a/pkg/front_end/parser_testcases/general/issue_45703.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/issue_45703.dart.intertwined.expect
@@ -27,7 +27,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Function, DeclarationKind.Class, Function)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -66,7 +66,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(>, DeclarationKind.Class, C)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -135,7 +135,7 @@
           listener: handleType(List, null)
           parseClassOrMixinOrExtensionBody(List, DeclarationKind.Extension, Function)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Extension, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Extension, 0, {, })
           listener: endExtensionDeclaration(extension, extension, on, })
   listener: endTopLevelDeclaration(})
@@ -171,7 +171,7 @@
           listener: handleType(List, null)
           parseClassOrMixinOrExtensionBody(>, DeclarationKind.Extension, E)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Extension, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Extension, 0, {, })
           listener: endExtensionDeclaration(extension, extension, on, })
   listener: endTopLevelDeclaration(})
@@ -196,7 +196,7 @@
           listener: handleMixinHeader(mixin)
         parseClassOrMixinOrExtensionBody(Function, DeclarationKind.Mixin, Function)
           listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Mixin, {)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endClassOrMixinOrExtensionBody(DeclarationKind.Mixin, 0, {, })
         listener: endMixinDeclaration(mixin, })
   listener: endTopLevelDeclaration(})
@@ -239,7 +239,7 @@
           listener: handleMixinHeader(mixin)
         parseClassOrMixinOrExtensionBody(>, DeclarationKind.Mixin, M)
           listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Mixin, {)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endClassOrMixinOrExtensionBody(DeclarationKind.Mixin, 0, {, })
         listener: endMixinDeclaration(mixin, })
   listener: endTopLevelDeclaration(})
@@ -266,7 +266,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, Function)
+          notEofOrType(CLOSE_CURLY_BRACKET, Function)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -288,7 +288,7 @@
                       listener: endInitializedIdentifier(ok)
                     ensureSemicolon(ok)
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, dynamic)
+          notEofOrType(CLOSE_CURLY_BRACKET, dynamic)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -310,7 +310,7 @@
                       listener: endInitializedIdentifier(okToo)
                     ensureSemicolon(okToo)
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/general/issue_45848_01.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/issue_45848_01.dart.intertwined.expect
index 6326455..535082b 100644
--- a/pkg/front_end/parser_testcases/general/issue_45848_01.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/issue_45848_01.dart.intertwined.expect
@@ -49,7 +49,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, print)
+          notEofOrType(CLOSE_CURLY_BRACKET, print)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -62,7 +62,6 @@
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(print, expression)
                               listener: handleNoTypeArguments(()
@@ -79,7 +78,6 @@
                                                 listener: beginLiteralString('b=)
                                                 parseIdentifierExpression($)
                                                   parseSend($, expression, ConstantPatternContext.none)
-                                                    isNextIdentifier($)
                                                     ensureIdentifier($, expression)
                                                       listener: handleIdentifier(b, expression)
                                                     listener: handleNoTypeArguments(, i=)
@@ -91,7 +89,6 @@
                                                   listener: handleStringPart(, i=)
                                                 parseIdentifierExpression($)
                                                   parseSend($, expression, ConstantPatternContext.none)
-                                                    isNextIdentifier($)
                                                     ensureIdentifier($, expression)
                                                       listener: handleIdentifier(i, expression)
                                                     listener: handleNoTypeArguments(')
@@ -106,7 +103,7 @@
                               listener: handleSend(print, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(print, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -170,7 +167,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, f)
+          notEofOrType(CLOSE_CURLY_BRACKET, f)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -183,7 +180,6 @@
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(f, expression)
                               listener: handleNoTypeArguments(()
@@ -197,7 +193,6 @@
                                           parsePrimary((, expression, ConstantPatternContext.none)
                                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                               parseSend((, expression, ConstantPatternContext.none)
-                                                isNextIdentifier(()
                                                 ensureIdentifier((, expression)
                                                   listener: handleIdentifier(x, expression)
                                                 listener: handleNoTypeArguments(<)
@@ -210,7 +205,6 @@
                                             parsePrimary(<, expression, ConstantPatternContext.none)
                                               parseSendOrFunctionLiteral(<, expression, ConstantPatternContext.none)
                                                 parseSend(<, expression, ConstantPatternContext.none)
-                                                  isNextIdentifier(<)
                                                   ensureIdentifier(<, expression)
                                                     listener: handleIdentifier(y, expression)
                                                   listener: handleNoTypeArguments(,)
@@ -231,7 +225,6 @@
                                                       parsePrimary((, expression, ConstantPatternContext.none)
                                                         parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                           parseSend((, expression, ConstantPatternContext.none)
-                                                            isNextIdentifier(()
                                                             ensureIdentifier((, expression)
                                                               listener: handleIdentifier(o, expression)
                                                             listener: handleNoTypeArguments(as)
@@ -260,7 +253,7 @@
                               listener: handleSend(f, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(f, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(g, null, })
   listener: endTopLevelDeclaration(})
@@ -288,7 +281,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, g)
+          notEofOrType(CLOSE_CURLY_BRACKET, g)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -301,7 +294,6 @@
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(g, expression)
                               listener: handleNoTypeArguments(()
@@ -352,7 +344,7 @@
                               listener: handleSend(g, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(g, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/general/issue_45848_01_prime.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/issue_45848_01_prime.dart.intertwined.expect
index 29ef98d..025e323 100644
--- a/pkg/front_end/parser_testcases/general/issue_45848_01_prime.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/issue_45848_01_prime.dart.intertwined.expect
@@ -49,7 +49,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, print)
+          notEofOrType(CLOSE_CURLY_BRACKET, print)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -62,7 +62,6 @@
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(print, expression)
                               listener: handleNoTypeArguments(()
@@ -79,7 +78,6 @@
                                                 listener: beginLiteralString('b=)
                                                 parseIdentifierExpression($)
                                                   parseSend($, expression, ConstantPatternContext.none)
-                                                    isNextIdentifier($)
                                                     ensureIdentifier($, expression)
                                                       listener: handleIdentifier(b, expression)
                                                     listener: handleNoTypeArguments(, i=)
@@ -91,7 +89,6 @@
                                                   listener: handleStringPart(, i=)
                                                 parseIdentifierExpression($)
                                                   parseSend($, expression, ConstantPatternContext.none)
-                                                    isNextIdentifier($)
                                                     ensureIdentifier($, expression)
                                                       listener: handleIdentifier(i, expression)
                                                     listener: handleNoTypeArguments(')
@@ -106,7 +103,7 @@
                               listener: handleSend(print, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(print, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -170,7 +167,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, f)
+          notEofOrType(CLOSE_CURLY_BRACKET, f)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -183,7 +180,6 @@
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(f, expression)
                               listener: handleNoTypeArguments(()
@@ -204,7 +200,6 @@
                                                       parsePrimary((, expression, ConstantPatternContext.none)
                                                         parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                           parseSend((, expression, ConstantPatternContext.none)
-                                                            isNextIdentifier(()
                                                             ensureIdentifier((, expression)
                                                               listener: handleIdentifier(x, expression)
                                                             listener: handleNoTypeArguments(<)
@@ -217,7 +212,6 @@
                                                         parsePrimary(<, expression, ConstantPatternContext.none)
                                                           parseSendOrFunctionLiteral(<, expression, ConstantPatternContext.none)
                                                             parseSend(<, expression, ConstantPatternContext.none)
-                                                              isNextIdentifier(<)
                                                               ensureIdentifier(<, expression)
                                                                 listener: handleIdentifier(y, expression)
                                                               listener: handleNoTypeArguments())
@@ -240,7 +234,6 @@
                                                       parsePrimary((, expression, ConstantPatternContext.none)
                                                         parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                           parseSend((, expression, ConstantPatternContext.none)
-                                                            isNextIdentifier(()
                                                             ensureIdentifier((, expression)
                                                               listener: handleIdentifier(o, expression)
                                                             listener: handleNoTypeArguments(as)
@@ -269,7 +262,7 @@
                               listener: handleSend(f, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(f, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(g, null, })
   listener: endTopLevelDeclaration(})
@@ -297,7 +290,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, g)
+          notEofOrType(CLOSE_CURLY_BRACKET, g)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -310,7 +303,6 @@
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(g, expression)
                               listener: handleNoTypeArguments(()
@@ -361,7 +353,7 @@
                               listener: handleSend(g, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(g, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/general/issue_45848_02.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/issue_45848_02.dart.intertwined.expect
index 48715d5..86fa5e0 100644
--- a/pkg/front_end/parser_testcases/general/issue_45848_02.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/issue_45848_02.dart.intertwined.expect
@@ -49,7 +49,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, print)
+          notEofOrType(CLOSE_CURLY_BRACKET, print)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -62,7 +62,6 @@
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(print, expression)
                               listener: handleNoTypeArguments(()
@@ -79,7 +78,6 @@
                                                 listener: beginLiteralString('b1=)
                                                 parseIdentifierExpression($)
                                                   parseSend($, expression, ConstantPatternContext.none)
-                                                    isNextIdentifier($)
                                                     ensureIdentifier($, expression)
                                                       listener: handleIdentifier(b1, expression)
                                                     listener: handleNoTypeArguments(, b2=)
@@ -91,7 +89,6 @@
                                                   listener: handleStringPart(, b2=)
                                                 parseIdentifierExpression($)
                                                   parseSend($, expression, ConstantPatternContext.none)
-                                                    isNextIdentifier($)
                                                     ensureIdentifier($, expression)
                                                       listener: handleIdentifier(b2, expression)
                                                     listener: handleNoTypeArguments(')
@@ -106,7 +103,7 @@
                               listener: handleSend(print, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(print, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -170,7 +167,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, f)
+          notEofOrType(CLOSE_CURLY_BRACKET, f)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -183,7 +180,6 @@
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(f, expression)
                               listener: handleNoTypeArguments(()
@@ -198,7 +194,6 @@
                                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                               looksLikeFunctionBody())
                                               parseSend((, expression, ConstantPatternContext.none)
-                                                isNextIdentifier(()
                                                 ensureIdentifier((, expression)
                                                   listener: handleIdentifier(x, expression)
                                                 listener: handleNoTypeArguments(<)
@@ -211,7 +206,6 @@
                                             parsePrimary(<, expression, ConstantPatternContext.none)
                                               parseSendOrFunctionLiteral(<, expression, ConstantPatternContext.none)
                                                 parseSend(<, expression, ConstantPatternContext.none)
-                                                  isNextIdentifier(<)
                                                   ensureIdentifier(<, expression)
                                                     listener: handleIdentifier(y, expression)
                                                   listener: handleNoTypeArguments(,)
@@ -238,7 +232,6 @@
                                                         parsePrimary((, expression, ConstantPatternContext.none)
                                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                             parseSend((, expression, ConstantPatternContext.none)
-                                                              isNextIdentifier(()
                                                               ensureIdentifier((, expression)
                                                                 listener: handleIdentifier(o, expression)
                                                               listener: handleNoTypeArguments(as)
@@ -261,7 +254,7 @@
                               listener: handleSend(f, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(f, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(g, null, })
   listener: endTopLevelDeclaration(})
@@ -289,7 +282,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, g)
+          notEofOrType(CLOSE_CURLY_BRACKET, g)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -302,7 +295,6 @@
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(g, expression)
                               listener: handleNoTypeArguments(()
@@ -332,7 +324,7 @@
                               listener: handleSend(g, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(g, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/general/issue_45848_02_prime.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/issue_45848_02_prime.dart.intertwined.expect
index 2c6e191..079bae8 100644
--- a/pkg/front_end/parser_testcases/general/issue_45848_02_prime.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/issue_45848_02_prime.dart.intertwined.expect
@@ -49,7 +49,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, print)
+          notEofOrType(CLOSE_CURLY_BRACKET, print)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -62,7 +62,6 @@
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(print, expression)
                               listener: handleNoTypeArguments(()
@@ -79,7 +78,6 @@
                                                 listener: beginLiteralString('b1=)
                                                 parseIdentifierExpression($)
                                                   parseSend($, expression, ConstantPatternContext.none)
-                                                    isNextIdentifier($)
                                                     ensureIdentifier($, expression)
                                                       listener: handleIdentifier(b1, expression)
                                                     listener: handleNoTypeArguments(, b2=)
@@ -91,7 +89,6 @@
                                                   listener: handleStringPart(, b2=)
                                                 parseIdentifierExpression($)
                                                   parseSend($, expression, ConstantPatternContext.none)
-                                                    isNextIdentifier($)
                                                     ensureIdentifier($, expression)
                                                       listener: handleIdentifier(b2, expression)
                                                     listener: handleNoTypeArguments(')
@@ -106,7 +103,7 @@
                               listener: handleSend(print, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(print, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -170,7 +167,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, f)
+          notEofOrType(CLOSE_CURLY_BRACKET, f)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -183,7 +180,6 @@
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(f, expression)
                               listener: handleNoTypeArguments(()
@@ -204,7 +200,6 @@
                                                       parsePrimary((, expression, ConstantPatternContext.none)
                                                         parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                           parseSend((, expression, ConstantPatternContext.none)
-                                                            isNextIdentifier(()
                                                             ensureIdentifier((, expression)
                                                               listener: handleIdentifier(x, expression)
                                                             listener: handleNoTypeArguments(<)
@@ -217,7 +212,6 @@
                                                         parsePrimary(<, expression, ConstantPatternContext.none)
                                                           parseSendOrFunctionLiteral(<, expression, ConstantPatternContext.none)
                                                             parseSend(<, expression, ConstantPatternContext.none)
-                                                              isNextIdentifier(<)
                                                               ensureIdentifier(<, expression)
                                                                 listener: handleIdentifier(y, expression)
                                                               listener: handleNoTypeArguments())
@@ -246,7 +240,6 @@
                                                         parsePrimary((, expression, ConstantPatternContext.none)
                                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                             parseSend((, expression, ConstantPatternContext.none)
-                                                              isNextIdentifier(()
                                                               ensureIdentifier((, expression)
                                                                 listener: handleIdentifier(o, expression)
                                                               listener: handleNoTypeArguments(as)
@@ -269,7 +262,7 @@
                               listener: handleSend(f, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(f, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(g, null, })
   listener: endTopLevelDeclaration(})
@@ -297,7 +290,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, g)
+          notEofOrType(CLOSE_CURLY_BRACKET, g)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -310,7 +303,6 @@
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(g, expression)
                               listener: handleNoTypeArguments(()
@@ -340,7 +332,7 @@
                               listener: handleSend(g, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(g, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/general/issue_45848_03.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/issue_45848_03.dart.intertwined.expect
index a657365..7471e10 100644
--- a/pkg/front_end/parser_testcases/general/issue_45848_03.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/issue_45848_03.dart.intertwined.expect
@@ -49,7 +49,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, print)
+          notEofOrType(CLOSE_CURLY_BRACKET, print)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -62,7 +62,6 @@
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(print, expression)
                               listener: handleNoTypeArguments(()
@@ -79,7 +78,6 @@
                                                 listener: beginLiteralString('b1=)
                                                 parseIdentifierExpression($)
                                                   parseSend($, expression, ConstantPatternContext.none)
-                                                    isNextIdentifier($)
                                                     ensureIdentifier($, expression)
                                                       listener: handleIdentifier(b1, expression)
                                                     listener: handleNoTypeArguments(, b2=)
@@ -91,7 +89,6 @@
                                                   listener: handleStringPart(, b2=)
                                                 parseIdentifierExpression($)
                                                   parseSend($, expression, ConstantPatternContext.none)
-                                                    isNextIdentifier($)
                                                     ensureIdentifier($, expression)
                                                       listener: handleIdentifier(b2, expression)
                                                     listener: handleNoTypeArguments(')
@@ -106,7 +103,7 @@
                               listener: handleSend(print, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(print, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -182,7 +179,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, f)
+          notEofOrType(CLOSE_CURLY_BRACKET, f)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -195,7 +192,6 @@
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(f, expression)
                               listener: handleNoTypeArguments(()
@@ -210,7 +206,6 @@
                                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                               looksLikeFunctionBody())
                                               parseSend((, expression, ConstantPatternContext.none)
-                                                isNextIdentifier(()
                                                 ensureIdentifier((, expression)
                                                   listener: handleIdentifier(x, expression)
                                                 listener: handleNoTypeArguments(<)
@@ -223,7 +218,6 @@
                                             parsePrimary(<, expression, ConstantPatternContext.none)
                                               parseSendOrFunctionLiteral(<, expression, ConstantPatternContext.none)
                                                 parseSend(<, expression, ConstantPatternContext.none)
-                                                  isNextIdentifier(<)
                                                   ensureIdentifier(<, expression)
                                                     listener: handleIdentifier(y, expression)
                                                   listener: handleNoTypeArguments(,)
@@ -244,7 +238,6 @@
                                                       parsePrimary((, expression, ConstantPatternContext.none)
                                                         parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                           parseSend((, expression, ConstantPatternContext.none)
-                                                            isNextIdentifier(()
                                                             ensureIdentifier((, expression)
                                                               listener: handleIdentifier(o, expression)
                                                             listener: handleNoTypeArguments(as)
@@ -275,7 +268,6 @@
                                                         parsePrimary((, expression, ConstantPatternContext.none)
                                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                             parseSend((, expression, ConstantPatternContext.none)
-                                                              isNextIdentifier(()
                                                               ensureIdentifier((, expression)
                                                                 listener: handleIdentifier(p, expression)
                                                               listener: handleNoTypeArguments(as)
@@ -298,7 +290,7 @@
                               listener: handleSend(f, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(f, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(g, null, })
   listener: endTopLevelDeclaration(})
@@ -326,7 +318,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, g)
+          notEofOrType(CLOSE_CURLY_BRACKET, g)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -339,7 +331,6 @@
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(g, expression)
                               listener: handleNoTypeArguments(()
@@ -375,7 +366,7 @@
                               listener: handleSend(g, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(g, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/general/issue_45848_03_prime.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/issue_45848_03_prime.dart.intertwined.expect
index 580b21f..f71bbaa 100644
--- a/pkg/front_end/parser_testcases/general/issue_45848_03_prime.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/issue_45848_03_prime.dart.intertwined.expect
@@ -49,7 +49,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, print)
+          notEofOrType(CLOSE_CURLY_BRACKET, print)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -62,7 +62,6 @@
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(print, expression)
                               listener: handleNoTypeArguments(()
@@ -79,7 +78,6 @@
                                                 listener: beginLiteralString('b1=)
                                                 parseIdentifierExpression($)
                                                   parseSend($, expression, ConstantPatternContext.none)
-                                                    isNextIdentifier($)
                                                     ensureIdentifier($, expression)
                                                       listener: handleIdentifier(b1, expression)
                                                     listener: handleNoTypeArguments(, b2=)
@@ -91,7 +89,6 @@
                                                   listener: handleStringPart(, b2=)
                                                 parseIdentifierExpression($)
                                                   parseSend($, expression, ConstantPatternContext.none)
-                                                    isNextIdentifier($)
                                                     ensureIdentifier($, expression)
                                                       listener: handleIdentifier(b2, expression)
                                                     listener: handleNoTypeArguments(')
@@ -106,7 +103,7 @@
                               listener: handleSend(print, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(print, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -182,7 +179,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, f)
+          notEofOrType(CLOSE_CURLY_BRACKET, f)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -195,7 +192,6 @@
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(f, expression)
                               listener: handleNoTypeArguments(()
@@ -216,7 +212,6 @@
                                                       parsePrimary((, expression, ConstantPatternContext.none)
                                                         parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                           parseSend((, expression, ConstantPatternContext.none)
-                                                            isNextIdentifier(()
                                                             ensureIdentifier((, expression)
                                                               listener: handleIdentifier(x, expression)
                                                             listener: handleNoTypeArguments(<)
@@ -229,7 +224,6 @@
                                                         parsePrimary(<, expression, ConstantPatternContext.none)
                                                           parseSendOrFunctionLiteral(<, expression, ConstantPatternContext.none)
                                                             parseSend(<, expression, ConstantPatternContext.none)
-                                                              isNextIdentifier(<)
                                                               ensureIdentifier(<, expression)
                                                                 listener: handleIdentifier(y, expression)
                                                               listener: handleNoTypeArguments())
@@ -252,7 +246,6 @@
                                                       parsePrimary((, expression, ConstantPatternContext.none)
                                                         parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                           parseSend((, expression, ConstantPatternContext.none)
-                                                            isNextIdentifier(()
                                                             ensureIdentifier((, expression)
                                                               listener: handleIdentifier(o, expression)
                                                             listener: handleNoTypeArguments(as)
@@ -283,7 +276,6 @@
                                                         parsePrimary((, expression, ConstantPatternContext.none)
                                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                             parseSend((, expression, ConstantPatternContext.none)
-                                                              isNextIdentifier(()
                                                               ensureIdentifier((, expression)
                                                                 listener: handleIdentifier(p, expression)
                                                               listener: handleNoTypeArguments(as)
@@ -306,7 +298,7 @@
                               listener: handleSend(f, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(f, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(g, null, })
   listener: endTopLevelDeclaration(})
@@ -334,7 +326,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, g)
+          notEofOrType(CLOSE_CURLY_BRACKET, g)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -347,7 +339,6 @@
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(g, expression)
                               listener: handleNoTypeArguments(()
@@ -383,7 +374,7 @@
                               listener: handleSend(g, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(g, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/general/issue_45848_04.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/issue_45848_04.dart.intertwined.expect
index 7341d09..a324ab3 100644
--- a/pkg/front_end/parser_testcases/general/issue_45848_04.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/issue_45848_04.dart.intertwined.expect
@@ -33,7 +33,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -60,7 +60,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, f)
+          notEofOrType(CLOSE_CURLY_BRACKET, f)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -73,7 +73,6 @@
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(f, expression)
                               listener: beginTypeArguments(<)
@@ -92,7 +91,7 @@
                               listener: handleSend(f, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(f, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/general/issue_45848_04_prime.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/issue_45848_04_prime.dart.intertwined.expect
index 1b42aeb..24cf827 100644
--- a/pkg/front_end/parser_testcases/general/issue_45848_04_prime.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/issue_45848_04_prime.dart.intertwined.expect
@@ -33,7 +33,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -60,7 +60,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, f)
+          notEofOrType(CLOSE_CURLY_BRACKET, f)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -73,7 +73,6 @@
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(f, expression)
                               listener: beginTypeArguments(<)
@@ -89,7 +88,7 @@
                               listener: handleSend(f, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(f, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/general/issue_45848_05.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/issue_45848_05.dart.intertwined.expect
index caf28a1..c756168 100644
--- a/pkg/front_end/parser_testcases/general/issue_45848_05.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/issue_45848_05.dart.intertwined.expect
@@ -49,7 +49,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, print)
+          notEofOrType(CLOSE_CURLY_BRACKET, print)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -62,7 +62,6 @@
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(print, expression)
                               listener: handleNoTypeArguments(()
@@ -79,7 +78,6 @@
                                                 listener: beginLiteralString('b1=)
                                                 parseIdentifierExpression($)
                                                   parseSend($, expression, ConstantPatternContext.none)
-                                                    isNextIdentifier($)
                                                     ensureIdentifier($, expression)
                                                       listener: handleIdentifier(b1, expression)
                                                     listener: handleNoTypeArguments(, b2=)
@@ -91,7 +89,6 @@
                                                   listener: handleStringPart(, b2=)
                                                 parseIdentifierExpression($)
                                                   parseSend($, expression, ConstantPatternContext.none)
-                                                    isNextIdentifier($)
                                                     ensureIdentifier($, expression)
                                                       listener: handleIdentifier(b2, expression)
                                                     listener: handleNoTypeArguments(')
@@ -106,7 +103,7 @@
                               listener: handleSend(print, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(print, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -182,7 +179,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, f)
+          notEofOrType(CLOSE_CURLY_BRACKET, f)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -195,7 +192,6 @@
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(f, expression)
                               listener: handleNoTypeArguments(()
@@ -210,7 +206,6 @@
                                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                               looksLikeFunctionBody())
                                               parseSend((, expression, ConstantPatternContext.none)
-                                                isNextIdentifier(()
                                                 ensureIdentifier((, expression)
                                                   listener: handleIdentifier(x, expression)
                                                 listener: beginTypeArguments(<)
@@ -231,7 +226,6 @@
                                                             parsePrimary((, expression, ConstantPatternContext.none)
                                                               parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                                 parseSend((, expression, ConstantPatternContext.none)
-                                                                  isNextIdentifier(()
                                                                   ensureIdentifier((, expression)
                                                                     listener: handleIdentifier(p, expression)
                                                                   listener: handleNoTypeArguments(as)
@@ -253,7 +247,7 @@
                               listener: handleSend(f, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(f, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(g1, null, })
   listener: endTopLevelDeclaration(})
@@ -329,7 +323,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, f)
+          notEofOrType(CLOSE_CURLY_BRACKET, f)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -342,7 +336,6 @@
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(f, expression)
                               listener: handleNoTypeArguments(()
@@ -357,7 +350,6 @@
                                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                               looksLikeFunctionBody())
                                               parseSend((, expression, ConstantPatternContext.none)
-                                                isNextIdentifier(()
                                                 ensureIdentifier((, expression)
                                                   listener: handleIdentifier(x, expression)
                                                 listener: beginTypeArguments(<)
@@ -378,7 +370,6 @@
                                                             parsePrimary((, expression, ConstantPatternContext.none)
                                                               parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                                 parseSend((, expression, ConstantPatternContext.none)
-                                                                  isNextIdentifier(()
                                                                   ensureIdentifier((, expression)
                                                                     listener: handleIdentifier(p, expression)
                                                                   listener: handleNoTypeArguments())
@@ -391,7 +382,7 @@
                               listener: handleSend(f, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(f, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(g2, null, })
   listener: endTopLevelDeclaration(})
@@ -419,7 +410,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, g1)
+          notEofOrType(CLOSE_CURLY_BRACKET, g1)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -432,7 +423,6 @@
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(g1, expression)
                               listener: handleNoTypeArguments(()
@@ -468,7 +458,7 @@
                               listener: handleSend(g1, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(g1, ;)
-          notEofOrValue(}, g2)
+          notEofOrType(CLOSE_CURLY_BRACKET, g2)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -481,7 +471,6 @@
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(g2, expression)
                               listener: handleNoTypeArguments(()
@@ -517,7 +506,7 @@
                               listener: handleSend(g2, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(g2, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/general/issue_45848_06.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/issue_45848_06.dart.intertwined.expect
index 65b9325..fb1adc4 100644
--- a/pkg/front_end/parser_testcases/general/issue_45848_06.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/issue_45848_06.dart.intertwined.expect
@@ -49,7 +49,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, print)
+          notEofOrType(CLOSE_CURLY_BRACKET, print)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -62,7 +62,6 @@
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(print, expression)
                               listener: handleNoTypeArguments(()
@@ -79,7 +78,6 @@
                                                 listener: beginLiteralString('b1=)
                                                 parseIdentifierExpression($)
                                                   parseSend($, expression, ConstantPatternContext.none)
-                                                    isNextIdentifier($)
                                                     ensureIdentifier($, expression)
                                                       listener: handleIdentifier(b1, expression)
                                                     listener: handleNoTypeArguments(, b2=)
@@ -91,7 +89,6 @@
                                                   listener: handleStringPart(, b2=)
                                                 parseIdentifierExpression($)
                                                   parseSend($, expression, ConstantPatternContext.none)
-                                                    isNextIdentifier($)
                                                     ensureIdentifier($, expression)
                                                       listener: handleIdentifier(b2, expression)
                                                     listener: handleNoTypeArguments(')
@@ -106,7 +103,7 @@
                               listener: handleSend(print, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(print, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -181,7 +178,7 @@
           inPlainSync()
         parseFunctionBody(async, false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, f)
+          notEofOrType(CLOSE_CURLY_BRACKET, f)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -194,7 +191,6 @@
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(f, expression)
                               listener: handleNoTypeArguments(()
@@ -209,7 +205,6 @@
                                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                               looksLikeFunctionBody())
                                               parseSend((, expression, ConstantPatternContext.none)
-                                                isNextIdentifier(()
                                                 ensureIdentifier((, expression)
                                                   listener: handleIdentifier(x, expression)
                                                 listener: beginTypeArguments(<)
@@ -241,7 +236,6 @@
                                                             parsePrimary((, expression, ConstantPatternContext.none)
                                                               parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                                 parseSend((, expression, ConstantPatternContext.none)
-                                                                  isNextIdentifier(()
                                                                   ensureIdentifier((, expression)
                                                                     listener: handleIdentifier(p, expression)
                                                                   listener: handleNoTypeArguments(as)
@@ -263,7 +257,7 @@
                               listener: handleSend(f, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(f, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -290,7 +284,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, g)
+          notEofOrType(CLOSE_CURLY_BRACKET, g)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -303,7 +297,6 @@
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(g, expression)
                               listener: handleNoTypeArguments(()
@@ -339,7 +332,7 @@
                               listener: handleSend(g, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(g, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -358,7 +351,7 @@
           listener: handleType(Map, null)
           parseClassOrMixinOrExtensionBody(Map, DeclarationKind.Extension, null)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Extension, {)
-            notEofOrValue(}, bool)
+            notEofOrType(CLOSE_CURLY_BRACKET, bool)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Extension, null)
               parseMetadataStar({)
                 listener: beginMetadataStar(bool)
@@ -398,7 +391,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement({)
                     parseStatementX({)
                       parseReturnStatement({)
@@ -412,11 +405,11 @@
                         ensureSemicolon(true)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endExtensionMethod(null, bool, (, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Extension, 1, {, })
           listener: endExtensionDeclaration(extension, extension, on, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/general/issue_45848_07.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/issue_45848_07.dart.intertwined.expect
index 3668ac0..8f86a7d 100644
--- a/pkg/front_end/parser_testcases/general/issue_45848_07.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/issue_45848_07.dart.intertwined.expect
@@ -49,7 +49,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, print)
+          notEofOrType(CLOSE_CURLY_BRACKET, print)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -62,7 +62,6 @@
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(print, expression)
                               listener: handleNoTypeArguments(()
@@ -79,7 +78,6 @@
                                                 listener: beginLiteralString('b1=)
                                                 parseIdentifierExpression($)
                                                   parseSend($, expression, ConstantPatternContext.none)
-                                                    isNextIdentifier($)
                                                     ensureIdentifier($, expression)
                                                       listener: handleIdentifier(b1, expression)
                                                     listener: handleNoTypeArguments(, b2=)
@@ -91,7 +89,6 @@
                                                   listener: handleStringPart(, b2=)
                                                 parseIdentifierExpression($)
                                                   parseSend($, expression, ConstantPatternContext.none)
-                                                    isNextIdentifier($)
                                                     ensureIdentifier($, expression)
                                                       listener: handleIdentifier(b2, expression)
                                                     listener: handleNoTypeArguments(')
@@ -106,7 +103,7 @@
                               listener: handleSend(print, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(print, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -206,7 +203,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, f)
+          notEofOrType(CLOSE_CURLY_BRACKET, f)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -219,7 +216,6 @@
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(f, expression)
                               listener: handleNoTypeArguments(()
@@ -234,7 +230,6 @@
                                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                               looksLikeFunctionBody())
                                               parseSend((, expression, ConstantPatternContext.none)
-                                                isNextIdentifier(()
                                                 ensureIdentifier((, expression)
                                                   listener: handleIdentifier(x, expression)
                                                 listener: beginTypeArguments(<)
@@ -275,7 +270,6 @@
                                                             parsePrimary((, expression, ConstantPatternContext.none)
                                                               parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                                 parseSend((, expression, ConstantPatternContext.none)
-                                                                  isNextIdentifier(()
                                                                   ensureIdentifier((, expression)
                                                                     listener: handleIdentifier(c, expression)
                                                                   listener: handleNoTypeArguments(,)
@@ -288,7 +282,6 @@
                                                             parsePrimary(,, expression, ConstantPatternContext.none)
                                                               parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                                                 parseSend(,, expression, ConstantPatternContext.none)
-                                                                  isNextIdentifier(,)
                                                                   ensureIdentifier(,, expression)
                                                                     listener: handleIdentifier(d, expression)
                                                                   listener: handleNoTypeArguments())
@@ -301,7 +294,7 @@
                               listener: handleSend(f, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(f, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(g, null, })
   listener: endTopLevelDeclaration(})
@@ -329,7 +322,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, g)
+          notEofOrType(CLOSE_CURLY_BRACKET, g)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -342,7 +335,6 @@
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(g, expression)
                               listener: handleNoTypeArguments(()
@@ -390,7 +382,7 @@
                               listener: handleSend(g, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(g, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/general/issue_47008_01.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/issue_47008_01.dart.intertwined.expect
index 9f8fd3a..5c361ab 100644
--- a/pkg/front_end/parser_testcases/general/issue_47008_01.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/issue_47008_01.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, a)
+          notEofOrType(CLOSE_CURLY_BRACKET, a)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -39,7 +39,6 @@
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(a, expression)
                               listener: handleNoTypeArguments(()
@@ -54,7 +53,6 @@
                                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                               looksLikeFunctionBody())
                                               parseSend((, expression, ConstantPatternContext.none)
-                                                isNextIdentifier(()
                                                 ensureIdentifier((, expression)
                                                   listener: handleIdentifier(b, expression)
                                                 listener: handleNoTypeArguments(<)
@@ -67,7 +65,6 @@
                                             parsePrimary(<, expression, ConstantPatternContext.none)
                                               parseSendOrFunctionLiteral(<, expression, ConstantPatternContext.none)
                                                 parseSend(<, expression, ConstantPatternContext.none)
-                                                  isNextIdentifier(<)
                                                   ensureIdentifier(<, expression)
                                                     listener: handleIdentifier(c, expression)
                                                   listener: handleNoTypeArguments(,)
@@ -81,7 +78,6 @@
                                           parsePrimary(,, expression, ConstantPatternContext.none)
                                             parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                               parseSend(,, expression, ConstantPatternContext.none)
-                                                isNextIdentifier(,)
                                                 ensureIdentifier(,, expression)
                                                   listener: handleIdentifier(d, expression)
                                                 listener: handleNoTypeArguments(<)
@@ -94,7 +90,6 @@
                                             parsePrimary(<, expression, ConstantPatternContext.none)
                                               parseSendOrFunctionLiteral(<, expression, ConstantPatternContext.none)
                                                 parseSend(<, expression, ConstantPatternContext.none)
-                                                  isNextIdentifier(<)
                                                   ensureIdentifier(<, expression)
                                                     listener: handleIdentifier(e, expression)
                                                   listener: handleNoTypeArguments(,)
@@ -128,7 +123,7 @@
                               listener: handleSend(a, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(a, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/general/issue_47008_02.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/issue_47008_02.dart.intertwined.expect
index 79aa1cb..06ae190 100644
--- a/pkg/front_end/parser_testcases/general/issue_47008_02.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/issue_47008_02.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, a)
+          notEofOrType(CLOSE_CURLY_BRACKET, a)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -39,7 +39,6 @@
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(a, expression)
                               listener: handleNoTypeArguments(()
@@ -54,7 +53,6 @@
                                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                               looksLikeFunctionBody())
                                               parseSend((, expression, ConstantPatternContext.none)
-                                                isNextIdentifier(()
                                                 ensureIdentifier((, expression)
                                                   listener: handleIdentifier(b, expression)
                                                 listener: handleNoTypeArguments(<)
@@ -67,7 +65,6 @@
                                             parsePrimary(<, expression, ConstantPatternContext.none)
                                               parseSendOrFunctionLiteral(<, expression, ConstantPatternContext.none)
                                                 parseSend(<, expression, ConstantPatternContext.none)
-                                                  isNextIdentifier(<)
                                                   ensureIdentifier(<, expression)
                                                     listener: handleIdentifier(c, expression)
                                                   listener: handleNoTypeArguments(,)
@@ -81,7 +78,6 @@
                                           parsePrimary(,, expression, ConstantPatternContext.none)
                                             parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                               parseSend(,, expression, ConstantPatternContext.none)
-                                                isNextIdentifier(,)
                                                 ensureIdentifier(,, expression)
                                                   listener: handleIdentifier(d, expression)
                                                 listener: handleNoTypeArguments(<)
@@ -94,7 +90,6 @@
                                             parsePrimary(<, expression, ConstantPatternContext.none)
                                               parseSendOrFunctionLiteral(<, expression, ConstantPatternContext.none)
                                                 parseSend(<, expression, ConstantPatternContext.none)
-                                                  isNextIdentifier(<)
                                                   ensureIdentifier(<, expression)
                                                     listener: handleIdentifier(e, expression)
                                                   listener: handleNoTypeArguments(,)
@@ -108,7 +103,6 @@
                                           parsePrimary(,, expression, ConstantPatternContext.none)
                                             parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                               parseSend(,, expression, ConstantPatternContext.none)
-                                                isNextIdentifier(,)
                                                 ensureIdentifier(,, expression)
                                                   listener: handleIdentifier(f, expression)
                                                 listener: handleNoTypeArguments(<)
@@ -121,7 +115,6 @@
                                             parsePrimary(<, expression, ConstantPatternContext.none)
                                               parseSendOrFunctionLiteral(<, expression, ConstantPatternContext.none)
                                                 parseSend(<, expression, ConstantPatternContext.none)
-                                                  isNextIdentifier(<)
                                                   ensureIdentifier(<, expression)
                                                     listener: handleIdentifier(g, expression)
                                                   listener: handleNoTypeArguments(,)
@@ -155,7 +148,7 @@
                               listener: handleSend(a, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(a, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/general/issue_47009_01.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/issue_47009_01.dart.intertwined.expect
index 659d36c..5e71ff8 100644
--- a/pkg/front_end/parser_testcases/general/issue_47009_01.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/issue_47009_01.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, a)
+          notEofOrType(CLOSE_CURLY_BRACKET, a)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -39,7 +39,6 @@
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(a, expression)
                               listener: handleNoTypeArguments(()
@@ -54,7 +53,6 @@
                                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                               looksLikeFunctionBody())
                                               parseSend((, expression, ConstantPatternContext.none)
-                                                isNextIdentifier(()
                                                 ensureIdentifier((, expression)
                                                   listener: handleIdentifier(b, expression)
                                                 listener: handleNoTypeArguments(<)
@@ -67,7 +65,6 @@
                                             parsePrimary(<, expression, ConstantPatternContext.none)
                                               parseSendOrFunctionLiteral(<, expression, ConstantPatternContext.none)
                                                 parseSend(<, expression, ConstantPatternContext.none)
-                                                  isNextIdentifier(<)
                                                   ensureIdentifier(<, expression)
                                                     listener: handleIdentifier(c, expression)
                                                   listener: handleNoTypeArguments(,)
@@ -82,7 +79,6 @@
                                             inPlainSync()
                                             parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                               parseSend(,, expression, ConstantPatternContext.none)
-                                                isNextIdentifier(,)
                                                 ensureIdentifier(,, expression)
                                                   inPlainSync()
                                                   listener: handleIdentifier(as, expression)
@@ -110,7 +106,7 @@
                               listener: handleSend(a, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(a, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/general/issue_47009_02.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/issue_47009_02.dart.intertwined.expect
index b16b586..eab7f66 100644
--- a/pkg/front_end/parser_testcases/general/issue_47009_02.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/issue_47009_02.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, a)
+          notEofOrType(CLOSE_CURLY_BRACKET, a)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -39,7 +39,6 @@
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(a, expression)
                               listener: handleNoTypeArguments(()
@@ -54,7 +53,6 @@
                                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                               looksLikeFunctionBody())
                                               parseSend((, expression, ConstantPatternContext.none)
-                                                isNextIdentifier(()
                                                 ensureIdentifier((, expression)
                                                   listener: handleIdentifier(b, expression)
                                                 listener: handleNoTypeArguments(<)
@@ -67,7 +65,6 @@
                                             parsePrimary(<, expression, ConstantPatternContext.none)
                                               parseSendOrFunctionLiteral(<, expression, ConstantPatternContext.none)
                                                 parseSend(<, expression, ConstantPatternContext.none)
-                                                  isNextIdentifier(<)
                                                   ensureIdentifier(<, expression)
                                                     listener: handleIdentifier(c, expression)
                                                   listener: handleNoTypeArguments(,)
@@ -81,7 +78,6 @@
                                           parsePrimary(,, expression, ConstantPatternContext.none)
                                             parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                               parseSend(,, expression, ConstantPatternContext.none)
-                                                isNextIdentifier(,)
                                                 ensureIdentifier(,, expression)
                                                   listener: handleIdentifier(d, expression)
                                                 listener: handleNoTypeArguments(<)
@@ -94,7 +90,6 @@
                                             parsePrimary(<, expression, ConstantPatternContext.none)
                                               parseSendOrFunctionLiteral(<, expression, ConstantPatternContext.none)
                                                 parseSend(<, expression, ConstantPatternContext.none)
-                                                  isNextIdentifier(<)
                                                   ensureIdentifier(<, expression)
                                                     listener: handleIdentifier(e, expression)
                                                   listener: handleNoTypeArguments(,)
@@ -109,7 +104,6 @@
                                             inPlainSync()
                                             parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                               parseSend(,, expression, ConstantPatternContext.none)
-                                                isNextIdentifier(,)
                                                 ensureIdentifier(,, expression)
                                                   inPlainSync()
                                                   listener: handleIdentifier(as, expression)
@@ -137,7 +131,7 @@
                               listener: handleSend(a, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(a, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/general/issue_47009_03.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/issue_47009_03.dart.intertwined.expect
index d9c886e..7bd5542 100644
--- a/pkg/front_end/parser_testcases/general/issue_47009_03.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/issue_47009_03.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, a)
+          notEofOrType(CLOSE_CURLY_BRACKET, a)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -39,7 +39,6 @@
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(a, expression)
                               listener: handleNoTypeArguments(()
@@ -54,7 +53,6 @@
                                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                               looksLikeFunctionBody())
                                               parseSend((, expression, ConstantPatternContext.none)
-                                                isNextIdentifier(()
                                                 ensureIdentifier((, expression)
                                                   listener: handleIdentifier(b, expression)
                                                 listener: handleNoTypeArguments(<)
@@ -67,7 +65,6 @@
                                             parsePrimary(<, expression, ConstantPatternContext.none)
                                               parseSendOrFunctionLiteral(<, expression, ConstantPatternContext.none)
                                                 parseSend(<, expression, ConstantPatternContext.none)
-                                                  isNextIdentifier(<)
                                                   ensureIdentifier(<, expression)
                                                     listener: handleIdentifier(c, expression)
                                                   listener: handleNoTypeArguments(,)
@@ -81,7 +78,6 @@
                                           parsePrimary(,, expression, ConstantPatternContext.none)
                                             parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                               parseSend(,, expression, ConstantPatternContext.none)
-                                                isNextIdentifier(,)
                                                 ensureIdentifier(,, expression)
                                                   listener: handleIdentifier(d, expression)
                                                 listener: handleNoTypeArguments(<)
@@ -94,7 +90,6 @@
                                             parsePrimary(<, expression, ConstantPatternContext.none)
                                               parseSendOrFunctionLiteral(<, expression, ConstantPatternContext.none)
                                                 parseSend(<, expression, ConstantPatternContext.none)
-                                                  isNextIdentifier(<)
                                                   ensureIdentifier(<, expression)
                                                     listener: handleIdentifier(e, expression)
                                                   listener: handleNoTypeArguments(,)
@@ -108,7 +103,6 @@
                                           parsePrimary(,, expression, ConstantPatternContext.none)
                                             parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                               parseSend(,, expression, ConstantPatternContext.none)
-                                                isNextIdentifier(,)
                                                 ensureIdentifier(,, expression)
                                                   listener: handleIdentifier(f, expression)
                                                 listener: handleNoTypeArguments(<)
@@ -121,7 +115,6 @@
                                             parsePrimary(<, expression, ConstantPatternContext.none)
                                               parseSendOrFunctionLiteral(<, expression, ConstantPatternContext.none)
                                                 parseSend(<, expression, ConstantPatternContext.none)
-                                                  isNextIdentifier(<)
                                                   ensureIdentifier(<, expression)
                                                     listener: handleIdentifier(g, expression)
                                                   listener: handleNoTypeArguments(,)
@@ -136,7 +129,6 @@
                                             inPlainSync()
                                             parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                               parseSend(,, expression, ConstantPatternContext.none)
-                                                isNextIdentifier(,)
                                                 ensureIdentifier(,, expression)
                                                   inPlainSync()
                                                   listener: handleIdentifier(as, expression)
@@ -164,7 +156,7 @@
                               listener: handleSend(a, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(a, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/general/issue_60785.crash_dart.intertwined.expect b/pkg/front_end/parser_testcases/general/issue_60785.crash_dart.intertwined.expect
index a2290ba..5411027 100644
--- a/pkg/front_end/parser_testcases/general/issue_60785.crash_dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/issue_60785.crash_dart.intertwined.expect
@@ -37,7 +37,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -50,7 +50,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(s, expression)
                                 listener: handleNoTypeArguments())
@@ -62,7 +61,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parseExpression(case)
@@ -94,7 +93,6 @@
                                   parseUnaryExpression(:, true, ConstantPatternContext.none)
                                     parsePrimary(:, expression, ConstantPatternContext.none)
                                       parseSend(:, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(:)
                                         ensureIdentifier(:, expression)
                                           reportRecoverableErrorWithToken(), Template(ExpectedIdentifier))
                                             listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got ')'., Try inserting an identifier before ')'., {lexeme: )}], ), ))
@@ -117,7 +115,7 @@
                         parseBlock(), BlockKind(statement))
                           ensureBlock(), BlockKind(statement))
                           listener: beginBlock({, BlockKind(statement))
-                          notEofOrValue(}, print)
+                          notEofOrType(CLOSE_CURLY_BRACKET, print)
                           parseStatement({)
                             parseStatementX({)
                               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -130,7 +128,6 @@
                                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                                             looksLikeFunctionBody(;)
                                             parseSend({, expression, ConstantPatternContext.none)
-                                              isNextIdentifier({)
                                               ensureIdentifier({, expression)
                                                 listener: handleIdentifier(print, expression)
                                               listener: handleNoTypeArguments(()
@@ -150,7 +147,7 @@
                                               listener: handleSend(print, ))
                                   ensureSemicolon())
                                   listener: handleExpressionStatement(print, ;)
-                          notEofOrValue(}, })
+                          notEofOrType(CLOSE_CURLY_BRACKET, })
                           listener: endBlock(1, {, }, BlockKind(statement))
                     peekPastLabels(else)
                     parseStatement(})
@@ -165,7 +162,6 @@
                                     parsePrimary(}, expression, ConstantPatternContext.none)
                                       inPlainSync()
                                       parseSend(}, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(})
                                         ensureIdentifier(}, expression)
                                           reportRecoverableErrorWithToken(else, Template(ExpectedIdentifier))
                                             listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got 'else'., Try inserting an identifier before 'else'., {lexeme: else}], else, else)
@@ -188,7 +184,7 @@
                         parseBlock(else, BlockKind(statement))
                           ensureBlock(else, BlockKind(statement))
                           listener: beginBlock({, BlockKind(statement))
-                          notEofOrValue(}, print)
+                          notEofOrType(CLOSE_CURLY_BRACKET, print)
                           parseStatement({)
                             parseStatementX({)
                               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -201,7 +197,6 @@
                                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                                             looksLikeFunctionBody(;)
                                             parseSend({, expression, ConstantPatternContext.none)
-                                              isNextIdentifier({)
                                               ensureIdentifier({, expression)
                                                 listener: handleIdentifier(print, expression)
                                               listener: handleNoTypeArguments(()
@@ -221,14 +216,14 @@
                                               listener: handleSend(print, ))
                                   ensureSemicolon())
                                   listener: handleExpressionStatement(print, ;)
-                          notEofOrValue(}, })
+                          notEofOrType(CLOSE_CURLY_BRACKET, })
                           listener: endBlock(1, {, }, BlockKind(statement))
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 4, case, })
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/general/metadata.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/metadata.dart.intertwined.expect
index ee7361c..6a5f4f9 100644
--- a/pkg/front_end/parser_testcases/general/metadata.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/metadata.dart.intertwined.expect
@@ -247,7 +247,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(X, DeclarationKind.Class, X)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -1721,7 +1721,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Y, DeclarationKind.Class, Y)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/general/missing_end_bracket.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/missing_end_bracket.dart.intertwined.expect
index adf8072..b461260 100644
--- a/pkg/front_end/parser_testcases/general/missing_end_bracket.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/missing_end_bracket.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, print)
+          notEofOrType(CLOSE_CURLY_BRACKET, print)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -39,7 +39,6 @@
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(print, expression)
                               listener: handleNoTypeArguments(()
@@ -59,7 +58,7 @@
                               listener: handleSend(print, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(print, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/general/new_as_identifier.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/new_as_identifier.dart.intertwined.expect
index 2b1b8dc..b92d656 100644
--- a/pkg/front_end/parser_testcases/general/new_as_identifier.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/new_as_identifier.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(C, DeclarationKind.Class, C)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, C)
+            notEofOrType(CLOSE_CURLY_BRACKET, C)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, C)
               parseMetadataStar({)
                 listener: beginMetadataStar(C)
@@ -61,7 +61,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, C, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, C)
+            notEofOrType(CLOSE_CURLY_BRACKET, C)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, C)
               parseMetadataStar(;)
                 listener: beginMetadataStar(C)
@@ -106,7 +106,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(, expression)
                                     listener: handleNoTypeArguments(=)
@@ -121,7 +120,6 @@
                               parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                   parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                    isNextIdentifier(.)
                                     ensureIdentifier(., expressionContinuation)
                                       listener: handleIdentifier(, expressionContinuation)
                                     listener: handleNoTypeArguments(new)
@@ -146,7 +144,7 @@
                   listener: handleInvalidFunctionBody({)
                 listener: endClassConstructor(null, C, (, :, })
               listener: endMember()
-            notEofOrValue(}, new)
+            notEofOrType(CLOSE_CURLY_BRACKET, new)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, C)
               parseMetadataStar(})
                 listener: beginMetadataStar(new)
@@ -157,7 +155,7 @@
                   listener: handleRecoverableError(Message[ExpectedClassMember, Expected a class member, but got 'new'., null, {lexeme: new}], new, new)
                 listener: handleInvalidMember(new)
                 listener: endMember()
-            notEofOrValue(}, =)
+            notEofOrType(CLOSE_CURLY_BRACKET, =)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(new, DeclarationKind.Class, C)
               parseMetadataStar(new)
                 listener: beginMetadataStar(=)
@@ -202,7 +200,7 @@
                       listener: handleInvalidFunctionBody({)
                     listener: endClassMethod(null, operator, (, null, })
                   listener: endMember()
-            notEofOrValue(}, null)
+            notEofOrType(CLOSE_CURLY_BRACKET, null)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, C)
               parseMetadataStar(})
                 listener: beginMetadataStar(null)
@@ -213,7 +211,7 @@
                   listener: handleRecoverableError(Message[ExpectedClassMember, Expected a class member, but got 'null'., null, {lexeme: null}], null, null)
                 listener: handleInvalidMember(null)
                 listener: endMember()
-            notEofOrValue(}, ;)
+            notEofOrType(CLOSE_CURLY_BRACKET, ;)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(null, DeclarationKind.Class, C)
               parseMetadataStar(null)
                 listener: beginMetadataStar(;)
@@ -224,7 +222,7 @@
                   listener: handleRecoverableError(Message[ExpectedClassMember, Expected a class member, but got ';'., null, {lexeme: ;}], ;, ;)
                 listener: handleInvalidMember(;)
                 listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 6, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -251,7 +249,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(D, DeclarationKind.Class, D)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, factory)
+            notEofOrType(CLOSE_CURLY_BRACKET, factory)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, D)
               parseMetadataStar({)
                 listener: beginMetadataStar(factory)
@@ -287,7 +285,6 @@
                             parseSendOrFunctionLiteral(=>, expression, ConstantPatternContext.none)
                               looksLikeFunctionBody(;)
                               parseSend(=>, expression, ConstantPatternContext.none)
-                                isNextIdentifier(=>)
                                 ensureIdentifier(=>, expression)
                                   listener: handleIdentifier(C, expression)
                                 listener: handleNoTypeArguments(()
@@ -302,7 +299,7 @@
                     inGenerator()
                 listener: endClassFactoryMethod(factory, factory, ;)
               listener: endMember()
-            notEofOrValue(}, factory)
+            notEofOrType(CLOSE_CURLY_BRACKET, factory)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, D)
               parseMetadataStar(;)
                 listener: beginMetadataStar(factory)
@@ -347,7 +344,7 @@
                   listener: endRedirectingFactoryBody(=, ;)
                 listener: endClassFactoryMethod(factory, factory, ;)
               listener: endMember()
-            notEofOrValue(}, factory)
+            notEofOrType(CLOSE_CURLY_BRACKET, factory)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, D)
               parseMetadataStar(;)
                 listener: beginMetadataStar(factory)
@@ -393,7 +390,7 @@
                   listener: endRedirectingFactoryBody(=, ;)
                 listener: endClassFactoryMethod(factory, factory, ;)
               listener: endMember()
-            notEofOrValue(}, factory)
+            notEofOrType(CLOSE_CURLY_BRACKET, factory)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, D)
               parseMetadataStar(;)
                 listener: beginMetadataStar(factory)
@@ -439,7 +436,7 @@
                   listener: endRedirectingFactoryBody(=, ;)
                 listener: endClassFactoryMethod(factory, factory, ;)
               listener: endMember()
-            notEofOrValue(}, factory)
+            notEofOrType(CLOSE_CURLY_BRACKET, factory)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, D)
               parseMetadataStar(;)
                 listener: beginMetadataStar(factory)
@@ -489,7 +486,7 @@
                   listener: endRedirectingFactoryBody(=, ;)
                 listener: endClassFactoryMethod(factory, factory, ;)
               listener: endMember()
-            notEofOrValue(}, D)
+            notEofOrType(CLOSE_CURLY_BRACKET, D)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, D)
               parseMetadataStar(;)
                 listener: beginMetadataStar(D)
@@ -531,7 +528,6 @@
                               parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                   parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                    isNextIdentifier(.)
                                     ensureIdentifier(., expressionContinuation)
                                       listener: handleIdentifier(new, expressionContinuation)
                                     listener: handleNoTypeArguments(()
@@ -552,7 +548,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, D, (, :, ;)
               listener: endMember()
-            notEofOrValue(}, D)
+            notEofOrType(CLOSE_CURLY_BRACKET, D)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, D)
               parseMetadataStar(;)
                 listener: beginMetadataStar(D)
@@ -593,7 +589,6 @@
                             parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                 parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                  isNextIdentifier(.)
                                   ensureIdentifier(., expressionContinuation)
                                     listener: handleIdentifier(new, expressionContinuation)
                                   listener: handleNoTypeArguments(()
@@ -614,7 +609,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, D, (, :, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 7, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -817,7 +812,6 @@
               parseUnaryExpression(=, true, ConstantPatternContext.none)
                 parsePrimary(=, expression, ConstantPatternContext.none)
                   parseNewExpression(=)
-                    isNextIdentifier(new)
                     listener: beginNewExpression(new)
                     parseConstructorReference(new, ConstructorReferenceContext.New, null)
                       ensureIdentifier(new, constructorReference)
@@ -861,7 +855,6 @@
               parseUnaryExpression(=, true, ConstantPatternContext.none)
                 parsePrimary(=, expression, ConstantPatternContext.none)
                   parseNewExpression(=)
-                    isNextIdentifier(new)
                     listener: beginNewExpression(new)
                     parseConstructorReference(new, ConstructorReferenceContext.New, null)
                       ensureIdentifier(new, constructorReference)
@@ -906,7 +899,6 @@
               parseUnaryExpression(=, true, ConstantPatternContext.none)
                 parsePrimary(=, expression, ConstantPatternContext.none)
                   parseNewExpression(=)
-                    isNextIdentifier(new)
                     listener: beginNewExpression(new)
                     parseConstructorReference(new, ConstructorReferenceContext.New, null)
                       ensureIdentifier(new, constructorReference)
@@ -951,7 +943,6 @@
               parseUnaryExpression(=, true, ConstantPatternContext.none)
                 parsePrimary(=, expression, ConstantPatternContext.none)
                   parseNewExpression(=)
-                    isNextIdentifier(new)
                     listener: beginNewExpression(new)
                     parseConstructorReference(new, ConstructorReferenceContext.New, null)
                       ensureIdentifier(new, constructorReference)
@@ -1001,7 +992,6 @@
                 parsePrimary(=, expression, ConstantPatternContext.none)
                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                     parseSend(=, expression, ConstantPatternContext.none)
-                      isNextIdentifier(=)
                       ensureIdentifier(=, expression)
                         listener: handleIdentifier(C, expression)
                       listener: handleNoTypeArguments(.)
@@ -1013,7 +1003,6 @@
                 listener: handleNewAsIdentifier(new)
                 parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                   parseSend(., expressionContinuation, ConstantPatternContext.none)
-                    isNextIdentifier(.)
                     ensureIdentifier(., expressionContinuation)
                       listener: handleIdentifier(new, expressionContinuation)
                     listener: handleNoTypeArguments(()
@@ -1091,7 +1080,6 @@
                 parsePrimary(=, expression, ConstantPatternContext.none)
                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                     parseSend(=, expression, ConstantPatternContext.none)
-                      isNextIdentifier(=)
                       ensureIdentifier(=, expression)
                         listener: handleIdentifier(prefix, expression)
                       listener: handleNoTypeArguments(.)
@@ -1101,7 +1089,6 @@
               parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                 parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                   parseSend(., expressionContinuation, ConstantPatternContext.none)
-                    isNextIdentifier(.)
                     ensureIdentifier(., expressionContinuation)
                       listener: handleIdentifier(C, expressionContinuation)
                     listener: handleNoTypeArguments(.)
@@ -1114,7 +1101,6 @@
                 listener: handleNewAsIdentifier(new)
                 parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                   parseSend(., expressionContinuation, ConstantPatternContext.none)
-                    isNextIdentifier(.)
                     ensureIdentifier(., expressionContinuation)
                       listener: handleIdentifier(new, expressionContinuation)
                     listener: handleNoTypeArguments(()
@@ -1196,7 +1182,6 @@
                 parsePrimary(=, expression, ConstantPatternContext.none)
                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                     parseSend(=, expression, ConstantPatternContext.none)
-                      isNextIdentifier(=)
                       ensureIdentifier(=, expression)
                         listener: handleIdentifier(C, expression)
                       listener: handleNoTypeArguments(.)
@@ -1208,7 +1193,6 @@
                 listener: handleNewAsIdentifier(new)
                 parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                   parseSend(., expressionContinuation, ConstantPatternContext.none)
-                    isNextIdentifier(.)
                     ensureIdentifier(., expressionContinuation)
                       listener: handleIdentifier(new, expressionContinuation)
                     listener: handleNoTypeArguments(;)
@@ -1240,7 +1224,6 @@
                 parsePrimary(=, expression, ConstantPatternContext.none)
                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                     parseSend(=, expression, ConstantPatternContext.none)
-                      isNextIdentifier(=)
                       ensureIdentifier(=, expression)
                         listener: handleIdentifier(C, expression)
                       listener: handleNoTypeArguments(<)
@@ -1258,7 +1241,6 @@
                 listener: handleNewAsIdentifier(new)
                 parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                   parseSend(., expressionContinuation, ConstantPatternContext.none)
-                    isNextIdentifier(.)
                     ensureIdentifier(., expressionContinuation)
                       listener: handleIdentifier(new, expressionContinuation)
                     listener: handleNoTypeArguments(;)
@@ -1290,7 +1272,6 @@
                 parsePrimary(=, expression, ConstantPatternContext.none)
                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                     parseSend(=, expression, ConstantPatternContext.none)
-                      isNextIdentifier(=)
                       ensureIdentifier(=, expression)
                         listener: handleIdentifier(C, expression)
                       listener: handleNoTypeArguments(<)
@@ -1308,7 +1289,6 @@
                 listener: handleNewAsIdentifier(new)
                 parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                   parseSend(., expressionContinuation, ConstantPatternContext.none)
-                    isNextIdentifier(.)
                     ensureIdentifier(., expressionContinuation)
                       listener: handleIdentifier(new, expressionContinuation)
                     listener: handleNoTypeArguments(.)
@@ -1319,7 +1299,6 @@
               parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                 parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                   parseSend(., expressionContinuation, ConstantPatternContext.none)
-                    isNextIdentifier(.)
                     ensureIdentifier(., expressionContinuation)
                       listener: handleIdentifier(toString, expressionContinuation)
                     listener: handleNoTypeArguments(()
@@ -1354,7 +1333,6 @@
                 parsePrimary(=, expression, ConstantPatternContext.none)
                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                     parseSend(=, expression, ConstantPatternContext.none)
-                      isNextIdentifier(=)
                       ensureIdentifier(=, expression)
                         listener: handleIdentifier(C, expression)
                       listener: handleNoTypeArguments(.)
@@ -1366,7 +1344,6 @@
                 listener: handleNewAsIdentifier(new)
                 parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                   parseSend(., expressionContinuation, ConstantPatternContext.none)
-                    isNextIdentifier(.)
                     ensureIdentifier(., expressionContinuation)
                       listener: handleIdentifier(new, expressionContinuation)
                     listener: handleNoTypeArguments(.)
@@ -1377,7 +1354,6 @@
               parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                 parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                   parseSend(., expressionContinuation, ConstantPatternContext.none)
-                    isNextIdentifier(.)
                     ensureIdentifier(., expressionContinuation)
                       listener: handleIdentifier(toString, expressionContinuation)
                     listener: handleNoTypeArguments(()
@@ -1412,7 +1388,6 @@
                 parsePrimary(=, expression, ConstantPatternContext.none)
                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                     parseSend(=, expression, ConstantPatternContext.none)
-                      isNextIdentifier(=)
                       ensureIdentifier(=, expression)
                         listener: handleIdentifier(prefix, expression)
                       listener: handleNoTypeArguments(.)
@@ -1422,7 +1397,6 @@
               parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                 parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                   parseSend(., expressionContinuation, ConstantPatternContext.none)
-                    isNextIdentifier(.)
                     ensureIdentifier(., expressionContinuation)
                       listener: handleIdentifier(C, expressionContinuation)
                     listener: handleNoTypeArguments(.)
@@ -1435,7 +1409,6 @@
                 listener: handleNewAsIdentifier(new)
                 parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                   parseSend(., expressionContinuation, ConstantPatternContext.none)
-                    isNextIdentifier(.)
                     ensureIdentifier(., expressionContinuation)
                       listener: handleIdentifier(new, expressionContinuation)
                     listener: handleNoTypeArguments(;)
@@ -1467,7 +1440,6 @@
                 parsePrimary(=, expression, ConstantPatternContext.none)
                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                     parseSend(=, expression, ConstantPatternContext.none)
-                      isNextIdentifier(=)
                       ensureIdentifier(=, expression)
                         listener: handleIdentifier(prefix, expression)
                       listener: handleNoTypeArguments(.)
@@ -1477,7 +1449,6 @@
               parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                 parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                   parseSend(., expressionContinuation, ConstantPatternContext.none)
-                    isNextIdentifier(.)
                     ensureIdentifier(., expressionContinuation)
                       listener: handleIdentifier(C, expressionContinuation)
                     listener: handleNoTypeArguments(<)
@@ -1496,7 +1467,6 @@
                 listener: handleNewAsIdentifier(new)
                 parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                   parseSend(., expressionContinuation, ConstantPatternContext.none)
-                    isNextIdentifier(.)
                     ensureIdentifier(., expressionContinuation)
                       listener: handleIdentifier(new, expressionContinuation)
                     listener: handleNoTypeArguments(;)
@@ -1528,7 +1498,6 @@
                 parsePrimary(=, expression, ConstantPatternContext.none)
                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                     parseSend(=, expression, ConstantPatternContext.none)
-                      isNextIdentifier(=)
                       ensureIdentifier(=, expression)
                         listener: handleIdentifier(prefix, expression)
                       listener: handleNoTypeArguments(.)
@@ -1538,7 +1507,6 @@
               parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                 parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                   parseSend(., expressionContinuation, ConstantPatternContext.none)
-                    isNextIdentifier(.)
                     ensureIdentifier(., expressionContinuation)
                       listener: handleIdentifier(C, expressionContinuation)
                     listener: handleNoTypeArguments(<)
@@ -1557,7 +1525,6 @@
                 listener: handleNewAsIdentifier(new)
                 parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                   parseSend(., expressionContinuation, ConstantPatternContext.none)
-                    isNextIdentifier(.)
                     ensureIdentifier(., expressionContinuation)
                       listener: handleIdentifier(new, expressionContinuation)
                     listener: handleNoTypeArguments(.)
@@ -1568,7 +1535,6 @@
               parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                 parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                   parseSend(., expressionContinuation, ConstantPatternContext.none)
-                    isNextIdentifier(.)
                     ensureIdentifier(., expressionContinuation)
                       listener: handleIdentifier(toString, expressionContinuation)
                     listener: handleNoTypeArguments(()
@@ -1603,7 +1569,6 @@
                 parsePrimary(=, expression, ConstantPatternContext.none)
                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                     parseSend(=, expression, ConstantPatternContext.none)
-                      isNextIdentifier(=)
                       ensureIdentifier(=, expression)
                         listener: handleIdentifier(prefix, expression)
                       listener: handleNoTypeArguments(.)
@@ -1613,7 +1578,6 @@
               parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                 parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                   parseSend(., expressionContinuation, ConstantPatternContext.none)
-                    isNextIdentifier(.)
                     ensureIdentifier(., expressionContinuation)
                       listener: handleIdentifier(C, expressionContinuation)
                     listener: handleNoTypeArguments(.)
@@ -1626,7 +1590,6 @@
                 listener: handleNewAsIdentifier(new)
                 parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                   parseSend(., expressionContinuation, ConstantPatternContext.none)
-                    isNextIdentifier(.)
                     ensureIdentifier(., expressionContinuation)
                       listener: handleIdentifier(new, expressionContinuation)
                     listener: handleNoTypeArguments(.)
@@ -1637,7 +1600,6 @@
               parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                 parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                   parseSend(., expressionContinuation, ConstantPatternContext.none)
-                    isNextIdentifier(.)
                     ensureIdentifier(., expressionContinuation)
                       listener: handleIdentifier(toString, expressionContinuation)
                     listener: handleNoTypeArguments(()
diff --git a/pkg/front_end/parser_testcases/general/not_call_on_after_try_block.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/not_call_on_after_try_block.dart.intertwined.expect
index ed4f6e0..89f8acc 100644
--- a/pkg/front_end/parser_testcases/general/not_call_on_after_try_block.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/not_call_on_after_try_block.dart.intertwined.expect
@@ -25,7 +25,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, try)
+          notEofOrType(CLOSE_CURLY_BRACKET, try)
           parseStatement({)
             parseStatementX({)
               parseTryStatement({)
@@ -33,12 +33,12 @@
                 parseBlock(try, BlockKind(try statement))
                   ensureBlock(try, BlockKind(try statement))
                   listener: beginBlock({, BlockKind(try statement))
-                  notEofOrValue(}, ;)
+                  notEofOrType(CLOSE_CURLY_BRACKET, ;)
                   parseStatement({)
                     parseStatementX({)
                       parseEmptyStatement({)
                         listener: handleEmptyStatement(;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlock(1, {, }, BlockKind(try statement))
                 listener: beginCatchClause(catch)
                 parseFormalParameters(catch, MemberKind.Catch)
@@ -59,12 +59,12 @@
                 parseBlock(), BlockKind(catch clause))
                   ensureBlock(), BlockKind(catch clause))
                   listener: beginBlock({, BlockKind(catch clause))
-                  notEofOrValue(}, ;)
+                  notEofOrType(CLOSE_CURLY_BRACKET, ;)
                   parseStatement({)
                     parseStatementX({)
                       parseEmptyStatement({)
                         listener: handleEmptyStatement(;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlock(1, {, }, BlockKind(catch clause))
                 listener: handleCatchBlock(null, catch, null)
                 listener: beginCatchClause(on)
@@ -75,12 +75,12 @@
                 parseBlock(Foo, BlockKind(catch clause))
                   ensureBlock(Foo, BlockKind(catch clause))
                   listener: beginBlock({, BlockKind(catch clause))
-                  notEofOrValue(}, ;)
+                  notEofOrType(CLOSE_CURLY_BRACKET, ;)
                   parseStatement({)
                     parseStatementX({)
                       parseEmptyStatement({)
                         listener: handleEmptyStatement(;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlock(1, {, }, BlockKind(catch clause))
                 listener: handleCatchBlock(on, null, null)
                 listener: beginCatchClause(on)
@@ -91,12 +91,12 @@
                 parseBlock(), BlockKind(catch clause))
                   ensureBlock(), BlockKind(catch clause))
                   listener: beginBlock({, BlockKind(catch clause))
-                  notEofOrValue(}, ;)
+                  notEofOrType(CLOSE_CURLY_BRACKET, ;)
                   parseStatement({)
                     parseStatementX({)
                       parseEmptyStatement({)
                         listener: handleEmptyStatement(;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlock(1, {, }, BlockKind(catch clause))
                 listener: handleCatchBlock(on, null, null)
                 listener: beginCatchClause(on)
@@ -127,12 +127,12 @@
                 parseBlock(), BlockKind(catch clause))
                   ensureBlock(), BlockKind(catch clause))
                   listener: beginBlock({, BlockKind(catch clause))
-                  notEofOrValue(}, ;)
+                  notEofOrType(CLOSE_CURLY_BRACKET, ;)
                   parseStatement({)
                     parseStatementX({)
                       parseEmptyStatement({)
                         listener: handleEmptyStatement(;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlock(1, {, }, BlockKind(catch clause))
                 listener: handleCatchBlock(on, null, null)
                 listener: beginCatchClause(on)
@@ -173,16 +173,16 @@
                 parseBlock(), BlockKind(catch clause))
                   ensureBlock(), BlockKind(catch clause))
                   listener: beginBlock({, BlockKind(catch clause))
-                  notEofOrValue(}, ;)
+                  notEofOrType(CLOSE_CURLY_BRACKET, ;)
                   parseStatement({)
                     parseStatementX({)
                       parseEmptyStatement({)
                         listener: handleEmptyStatement(;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlock(1, {, }, BlockKind(catch clause))
                 listener: handleCatchBlock(on, null, null)
                 listener: endTryStatement(5, try, null, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -243,7 +243,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
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
index fbdd903..a78f1db 100644
--- a/pkg/front_end/parser_testcases/general/operator_01.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/operator_01.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Foo, DeclarationKind.Class, Foo)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, bool)
+            notEofOrType(CLOSE_CURLY_BRACKET, bool)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Foo)
               parseMetadataStar({)
                 listener: beginMetadataStar(bool)
@@ -65,7 +65,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement({)
                     parseStatementX({)
                       parseReturnStatement({)
@@ -79,11 +79,11 @@
                         ensureSemicolon(true)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(null, bool, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -123,7 +123,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement({)
                     parseStatementX({)
                       parseReturnStatement({)
@@ -137,11 +137,11 @@
                         ensureSemicolon(42)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, bool)
+            notEofOrType(CLOSE_CURLY_BRACKET, bool)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(bool)
@@ -181,7 +181,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement({)
                     parseStatementX({)
                       parseReturnStatement({)
@@ -195,11 +195,11 @@
                         ensureSemicolon(true)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(null, bool, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -239,7 +239,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement({)
                     parseStatementX({)
                       parseReturnStatement({)
@@ -253,11 +253,11 @@
                         ensureSemicolon(42)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -297,7 +297,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement({)
                     parseStatementX({)
                       parseReturnStatement({)
@@ -311,11 +311,11 @@
                         ensureSemicolon(42)
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(null, int, (, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 5, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/general/operator_hat_class.crash_dart.intertwined.expect b/pkg/front_end/parser_testcases/general/operator_hat_class.crash_dart.intertwined.expect
index b17bf6b..9fd6bb6 100644
--- a/pkg/front_end/parser_testcases/general/operator_hat_class.crash_dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/operator_hat_class.crash_dart.intertwined.expect
@@ -27,7 +27,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(operator, DeclarationKind.Class, operator)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, operator)
+            notEofOrType(CLOSE_CURLY_BRACKET, operator)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, operator)
               parseMetadataStar({)
                 listener: beginMetadataStar(operator)
@@ -65,11 +65,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassConstructor(null, operator, (, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/general/toplevel_get_called_get.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/toplevel_get_called_get.dart.intertwined.expect
index 5313f37..0fdbe32 100644
--- a/pkg/front_end/parser_testcases/general/toplevel_get_called_get.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/toplevel_get_called_get.dart.intertwined.expect
@@ -62,7 +62,7 @@
         inPlainSync()
         parseFunctionBody(get, false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, throw)
+          notEofOrType(CLOSE_CURLY_BRACKET, throw)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -82,7 +82,7 @@
                         listener: handleThrowExpression(throw, "hello")
                     ensureSemicolon("hello")
                     listener: handleExpressionStatement(throw, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(dynamic, get, })
   listener: endTopLevelDeclaration(})
@@ -146,7 +146,7 @@
         inPlainSync()
         parseFunctionBody(async, false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, throw)
+          notEofOrType(CLOSE_CURLY_BRACKET, throw)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -166,7 +166,7 @@
                         listener: handleThrowExpression(throw, "hello")
                     ensureSemicolon("hello")
                     listener: handleExpressionStatement(throw, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(dynamic, get, })
   listener: endTopLevelDeclaration(})
@@ -231,7 +231,7 @@
         inPlainSync()
         parseFunctionBody(*, false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, throw)
+          notEofOrType(CLOSE_CURLY_BRACKET, throw)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -251,7 +251,7 @@
                         listener: handleThrowExpression(throw, "hello")
                     ensureSemicolon("hello")
                     listener: handleExpressionStatement(throw, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(dynamic, get, })
   listener: endTopLevelDeclaration(})
@@ -316,7 +316,7 @@
         inPlainSync()
         parseFunctionBody(*, false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, throw)
+          notEofOrType(CLOSE_CURLY_BRACKET, throw)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -336,7 +336,7 @@
                         listener: handleThrowExpression(throw, "hello")
                     ensureSemicolon("hello")
                     listener: handleExpressionStatement(throw, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(dynamic, get, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/general/try_catch.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/try_catch.dart.intertwined.expect
index d237a6a..926c50d 100644
--- a/pkg/front_end/parser_testcases/general/try_catch.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/try_catch.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, try)
+          notEofOrType(CLOSE_CURLY_BRACKET, try)
           parseStatement({)
             parseStatementX({)
               parseTryStatement({)
@@ -34,7 +34,7 @@
                 parseBlock(try, BlockKind(try statement))
                   ensureBlock(try, BlockKind(try statement))
                   listener: beginBlock({, BlockKind(try statement))
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlock(0, {, }, BlockKind(try statement))
                 listener: beginCatchClause(catch)
                 parseFormalParameters(catch, MemberKind.Catch)
@@ -65,11 +65,11 @@
                 parseBlock(), BlockKind(catch clause))
                   ensureBlock(), BlockKind(catch clause))
                   listener: beginBlock({, BlockKind(catch clause))
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlock(0, {, }, BlockKind(catch clause))
                 listener: handleCatchBlock(null, catch, ,)
                 listener: endTryStatement(1, try, null, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/general/try_finally.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/try_finally.dart.intertwined.expect
index 71a4db7..536800e 100644
--- a/pkg/front_end/parser_testcases/general/try_finally.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/general/try_finally.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, try)
+          notEofOrType(CLOSE_CURLY_BRACKET, try)
           parseStatement({)
             parseStatementX({)
               parseTryStatement({)
@@ -34,16 +34,16 @@
                 parseBlock(try, BlockKind(try statement))
                   ensureBlock(try, BlockKind(try statement))
                   listener: beginBlock({, BlockKind(try statement))
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlock(0, {, }, BlockKind(try statement))
                 parseBlock(finally, BlockKind(finally clause))
                   ensureBlock(finally, BlockKind(finally clause))
                   listener: beginBlock({, BlockKind(finally clause))
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlock(0, {, }, BlockKind(finally clause))
                 listener: handleFinallyBlock(finally)
                 listener: endTryStatement(0, try, finally, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/inline_class/extends_with.dart.intertwined.expect b/pkg/front_end/parser_testcases/inline_class/extends_with.dart.intertwined.expect
index 346bfb2..66ff32a 100644
--- a/pkg/front_end/parser_testcases/inline_class/extends_with.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/inline_class/extends_with.dart.intertwined.expect
@@ -52,7 +52,7 @@
           ensureBlock(Foo, BlockKind(extension type declaration))
           parseClassOrMixinOrExtensionBody(Foo, DeclarationKind.ExtensionType, ET1)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 0, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
@@ -109,7 +109,7 @@
           ensureBlock(Foo, BlockKind(extension type declaration))
           parseClassOrMixinOrExtensionBody(Foo, DeclarationKind.ExtensionType, ET2)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 0, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
@@ -169,7 +169,7 @@
           ensureBlock(Bar, BlockKind(extension type declaration))
           parseClassOrMixinOrExtensionBody(Bar, DeclarationKind.ExtensionType, ET3)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 0, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
@@ -231,7 +231,7 @@
           ensureBlock(Bar, BlockKind(extension type declaration))
           parseClassOrMixinOrExtensionBody(Bar, DeclarationKind.ExtensionType, ET4)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 0, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
@@ -296,7 +296,7 @@
           ensureBlock(Baz, BlockKind(extension type declaration))
           parseClassOrMixinOrExtensionBody(Baz, DeclarationKind.ExtensionType, ET5)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 0, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
@@ -353,7 +353,7 @@
           ensureBlock(Bar, BlockKind(extension type declaration))
           parseClassOrMixinOrExtensionBody(Bar, DeclarationKind.ExtensionType, ET6)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 0, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
@@ -413,7 +413,7 @@
           ensureBlock(Bar, BlockKind(extension type declaration))
           parseClassOrMixinOrExtensionBody(Bar, DeclarationKind.ExtensionType, ET7)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 0, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
@@ -476,7 +476,7 @@
           ensureBlock(Baz, BlockKind(extension type declaration))
           parseClassOrMixinOrExtensionBody(Baz, DeclarationKind.ExtensionType, ET8)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 0, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
@@ -541,7 +541,7 @@
           ensureBlock(Baz, BlockKind(extension type declaration))
           parseClassOrMixinOrExtensionBody(Baz, DeclarationKind.ExtensionType, ET9)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 0, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
@@ -609,7 +609,7 @@
           ensureBlock(Boz, BlockKind(extension type declaration))
           parseClassOrMixinOrExtensionBody(Boz, DeclarationKind.ExtensionType, ET10)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 0, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
@@ -666,7 +666,7 @@
           ensureBlock(Foo, BlockKind(extension type declaration))
           parseClassOrMixinOrExtensionBody(Foo, DeclarationKind.ExtensionType, ET11)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 0, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
@@ -726,7 +726,7 @@
           ensureBlock(Foo, BlockKind(extension type declaration))
           parseClassOrMixinOrExtensionBody(Foo, DeclarationKind.ExtensionType, ET12)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 0, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
@@ -789,7 +789,7 @@
           ensureBlock(Bar, BlockKind(extension type declaration))
           parseClassOrMixinOrExtensionBody(Bar, DeclarationKind.ExtensionType, ET13)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 0, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
@@ -854,7 +854,7 @@
           ensureBlock(Bar, BlockKind(extension type declaration))
           parseClassOrMixinOrExtensionBody(Bar, DeclarationKind.ExtensionType, ET14)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 0, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
@@ -922,7 +922,7 @@
           ensureBlock(Baz, BlockKind(extension type declaration))
           parseClassOrMixinOrExtensionBody(Baz, DeclarationKind.ExtensionType, ET15)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 0, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
@@ -984,7 +984,7 @@
           ensureBlock(Bar, BlockKind(extension type declaration))
           parseClassOrMixinOrExtensionBody(Bar, DeclarationKind.ExtensionType, ET16)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 0, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
@@ -1049,7 +1049,7 @@
           ensureBlock(Bar, BlockKind(extension type declaration))
           parseClassOrMixinOrExtensionBody(Bar, DeclarationKind.ExtensionType, ET17)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 0, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
@@ -1117,7 +1117,7 @@
           ensureBlock(Baz, BlockKind(extension type declaration))
           parseClassOrMixinOrExtensionBody(Baz, DeclarationKind.ExtensionType, ET18)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 0, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
@@ -1187,7 +1187,7 @@
           ensureBlock(Baz, BlockKind(extension type declaration))
           parseClassOrMixinOrExtensionBody(Baz, DeclarationKind.ExtensionType, ET19)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 0, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
@@ -1260,7 +1260,7 @@
           ensureBlock(Boz, BlockKind(extension type declaration))
           parseClassOrMixinOrExtensionBody(Boz, DeclarationKind.ExtensionType, ET20)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 0, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
@@ -1317,7 +1317,7 @@
           ensureBlock(Boz, BlockKind(extension type declaration))
           parseClassOrMixinOrExtensionBody(Boz, DeclarationKind.ExtensionType, ET21)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 0, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
@@ -1385,7 +1385,7 @@
           ensureBlock(Boz, BlockKind(extension type declaration))
           parseClassOrMixinOrExtensionBody(Boz, DeclarationKind.ExtensionType, ET22)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 0, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
@@ -1442,7 +1442,7 @@
           ensureBlock(Boz, BlockKind(extension type declaration))
           parseClassOrMixinOrExtensionBody(Boz, DeclarationKind.ExtensionType, ET23)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 0, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/inline_class/extension_type.dart.intertwined.expect b/pkg/front_end/parser_testcases/inline_class/extension_type.dart.intertwined.expect
index ce968b1..149f572 100644
--- a/pkg/front_end/parser_testcases/inline_class/extension_type.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/inline_class/extension_type.dart.intertwined.expect
@@ -34,7 +34,7 @@
             listener: handleImplements(null, 0)
           parseClassOrMixinOrExtensionBody(), DeclarationKind.ExtensionType, ExtensionType1)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 0, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
@@ -76,7 +76,7 @@
             listener: handleImplements(implements, 2)
           parseClassOrMixinOrExtensionBody(int, DeclarationKind.ExtensionType, ExtensionType2)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 0, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
@@ -124,7 +124,7 @@
             listener: handleImplements(null, 0)
           parseClassOrMixinOrExtensionBody(), DeclarationKind.ExtensionType, ExtensionType3)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 0, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
@@ -160,7 +160,7 @@
             listener: handleImplements(null, 0)
           parseClassOrMixinOrExtensionBody(), DeclarationKind.ExtensionType, ExtensionType4)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, ExtensionType4)
+            notEofOrType(CLOSE_CURLY_BRACKET, ExtensionType4)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.ExtensionType, ExtensionType4)
               parseMetadataStar({)
                 listener: beginMetadataStar(ExtensionType4)
@@ -204,7 +204,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endExtensionTypeConstructor(null, ExtensionType4, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, ExtensionType4)
+            notEofOrType(CLOSE_CURLY_BRACKET, ExtensionType4)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.ExtensionType, ExtensionType4)
               parseMetadataStar(;)
                 listener: beginMetadataStar(ExtensionType4)
@@ -262,7 +262,6 @@
                                             parsePrimary((, expression, ConstantPatternContext.none)
                                               parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                 parseSend((, expression, ConstantPatternContext.none)
-                                                  isNextIdentifier(()
                                                   ensureIdentifier((, expression)
                                                     listener: handleIdentifier(it, expression)
                                                   listener: handleNoTypeArguments())
@@ -281,7 +280,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endExtensionTypeConstructor(null, ExtensionType4, (, :, ;)
               listener: endMember()
-            notEofOrValue(}, factory)
+            notEofOrType(CLOSE_CURLY_BRACKET, factory)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.ExtensionType, ExtensionType4)
               parseMetadataStar(;)
                 listener: beginMetadataStar(factory)
@@ -327,7 +326,6 @@
                             parseSendOrFunctionLiteral(=>, expression, ConstantPatternContext.none)
                               looksLikeFunctionBody(;)
                               parseSend(=>, expression, ConstantPatternContext.none)
-                                isNextIdentifier(=>)
                                 ensureIdentifier(=>, expression)
                                   listener: handleIdentifier(ExtensionType4, expression)
                                 listener: handleNoTypeArguments(()
@@ -341,7 +339,6 @@
                                             parsePrimary((, expression, ConstantPatternContext.none)
                                               parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                 parseSend((, expression, ConstantPatternContext.none)
-                                                  isNextIdentifier(()
                                                   ensureIdentifier((, expression)
                                                     listener: handleIdentifier(it, expression)
                                                   listener: handleNoTypeArguments())
@@ -355,7 +352,7 @@
                     inGenerator()
                 listener: endExtensionTypeFactoryMethod(factory, factory, ;)
               listener: endMember()
-            notEofOrValue(}, factory)
+            notEofOrType(CLOSE_CURLY_BRACKET, factory)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.ExtensionType, ExtensionType4)
               parseMetadataStar(;)
                 listener: beginMetadataStar(factory)
@@ -406,7 +403,7 @@
                   listener: endRedirectingFactoryBody(=, ;)
                 listener: endExtensionTypeFactoryMethod(factory, factory, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.ExtensionType, ExtensionType4)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -432,7 +429,7 @@
                   listener: handleRecoverableError(ExtensionTypeDeclaresInstanceField, field, field)
                 listener: endExtensionTypeFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.ExtensionType, ExtensionType4)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -464,7 +461,6 @@
                           parsePrimary(=>, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(=>, expression, ConstantPatternContext.none)
                               parseSend(=>, expression, ConstantPatternContext.none)
-                                isNextIdentifier(=>)
                                 ensureIdentifier(=>, expression)
                                   listener: handleIdentifier(it, expression)
                                 listener: handleNoTypeArguments(;)
@@ -476,7 +472,7 @@
                     inGenerator()
                 listener: endExtensionTypeMethod(get, int, =>, null, ;)
               listener: endMember()
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.ExtensionType, ExtensionType4)
               parseMetadataStar(;)
                 listener: beginMetadataStar(void)
@@ -515,11 +511,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endExtensionTypeMethod(set, void, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.ExtensionType, ExtensionType4)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -554,7 +550,6 @@
                           parsePrimary(=>, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(=>, expression, ConstantPatternContext.none)
                               parseSend(=>, expression, ConstantPatternContext.none)
-                                isNextIdentifier(=>)
                                 ensureIdentifier(=>, expression)
                                   listener: handleIdentifier(it, expression)
                                 listener: handleNoTypeArguments(;)
@@ -566,7 +561,7 @@
                     inGenerator()
                 listener: endExtensionTypeMethod(null, int, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.ExtensionType, ExtensionType4)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -612,7 +607,6 @@
                           parsePrimary(=>, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(=>, expression, ConstantPatternContext.none)
                               parseSend(=>, expression, ConstantPatternContext.none)
-                                isNextIdentifier(=>)
                                 ensureIdentifier(=>, expression)
                                   listener: handleIdentifier(it, expression)
                                 listener: handleNoTypeArguments(;)
@@ -624,7 +618,7 @@
                     inGenerator()
                 listener: endExtensionTypeMethod(null, int, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.ExtensionType, ExtensionType4)
               parseMetadataStar(;)
                 listener: beginMetadataStar(void)
@@ -674,11 +668,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endExtensionTypeMethod(null, void, (, null, })
               listener: endMember()
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.ExtensionType, ExtensionType4)
               parseMetadataStar(})
                 listener: beginMetadataStar(static)
@@ -702,7 +696,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endExtensionTypeFields(null, null, null, static, null, null, null, 1, static, ;)
               listener: endMember()
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.ExtensionType, ExtensionType4)
               parseMetadataStar(;)
                 listener: beginMetadataStar(static)
@@ -738,7 +732,7 @@
                     inGenerator()
                 listener: endExtensionTypeMethod(get, static, =>, null, ;)
               listener: endMember()
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.ExtensionType, ExtensionType4)
               parseMetadataStar(;)
                 listener: beginMetadataStar(static)
@@ -776,11 +770,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, false)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endExtensionTypeMethod(set, static, (, null, })
               listener: endMember()
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.ExtensionType, ExtensionType4)
               parseMetadataStar(})
                 listener: beginMetadataStar(static)
@@ -819,7 +813,7 @@
                     inGenerator()
                 listener: endExtensionTypeMethod(null, static, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 14, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
@@ -859,7 +853,7 @@
             listener: handleImplements(null, 0)
           parseClassOrMixinOrExtensionBody(), DeclarationKind.ExtensionType, ExtensionType5)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 0, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
@@ -897,7 +891,7 @@
             listener: handleImplements(null, 0)
           parseClassOrMixinOrExtensionBody(), DeclarationKind.ExtensionType, ExtensionType6)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 0, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
@@ -947,7 +941,7 @@
             listener: handleImplements(null, 0)
           parseClassOrMixinOrExtensionBody(), DeclarationKind.ExtensionType, ExtensionType7)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 0, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/inline_class/extension_type_const.dart.intertwined.expect b/pkg/front_end/parser_testcases/inline_class/extension_type_const.dart.intertwined.expect
index 83c5b9e..44722a3 100644
--- a/pkg/front_end/parser_testcases/inline_class/extension_type_const.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/inline_class/extension_type_const.dart.intertwined.expect
@@ -34,7 +34,7 @@
             listener: handleImplements(null, 0)
           parseClassOrMixinOrExtensionBody(), DeclarationKind.ExtensionType, ExtensionType1)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 0, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
@@ -76,7 +76,7 @@
             listener: handleImplements(implements, 2)
           parseClassOrMixinOrExtensionBody(int, DeclarationKind.ExtensionType, ExtensionType2)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 0, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
@@ -124,7 +124,7 @@
             listener: handleImplements(null, 0)
           parseClassOrMixinOrExtensionBody(), DeclarationKind.ExtensionType, ExtensionType3)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 0, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
@@ -160,7 +160,7 @@
             listener: handleImplements(null, 0)
           parseClassOrMixinOrExtensionBody(), DeclarationKind.ExtensionType, ExtensionType4)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, const)
+            notEofOrType(CLOSE_CURLY_BRACKET, const)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.ExtensionType, ExtensionType4)
               parseMetadataStar({)
                 listener: beginMetadataStar(const)
@@ -205,7 +205,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endExtensionTypeConstructor(null, const, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, const)
+            notEofOrType(CLOSE_CURLY_BRACKET, const)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.ExtensionType, ExtensionType4)
               parseMetadataStar(;)
                 listener: beginMetadataStar(const)
@@ -264,7 +264,6 @@
                                             parsePrimary((, expression, ConstantPatternContext.none)
                                               parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                 parseSend((, expression, ConstantPatternContext.none)
-                                                  isNextIdentifier(()
                                                   ensureIdentifier((, expression)
                                                     listener: handleIdentifier(it, expression)
                                                   listener: handleNoTypeArguments())
@@ -283,7 +282,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endExtensionTypeConstructor(null, const, (, :, ;)
               listener: endMember()
-            notEofOrValue(}, factory)
+            notEofOrType(CLOSE_CURLY_BRACKET, factory)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.ExtensionType, ExtensionType4)
               parseMetadataStar(;)
                 listener: beginMetadataStar(factory)
@@ -329,7 +328,6 @@
                             parseSendOrFunctionLiteral(=>, expression, ConstantPatternContext.none)
                               looksLikeFunctionBody(;)
                               parseSend(=>, expression, ConstantPatternContext.none)
-                                isNextIdentifier(=>)
                                 ensureIdentifier(=>, expression)
                                   listener: handleIdentifier(ExtensionType4, expression)
                                 listener: handleNoTypeArguments(()
@@ -343,7 +341,6 @@
                                             parsePrimary((, expression, ConstantPatternContext.none)
                                               parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                 parseSend((, expression, ConstantPatternContext.none)
-                                                  isNextIdentifier(()
                                                   ensureIdentifier((, expression)
                                                     listener: handleIdentifier(it, expression)
                                                   listener: handleNoTypeArguments())
@@ -357,7 +354,7 @@
                     inGenerator()
                 listener: endExtensionTypeFactoryMethod(factory, factory, ;)
               listener: endMember()
-            notEofOrValue(}, const)
+            notEofOrType(CLOSE_CURLY_BRACKET, const)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.ExtensionType, ExtensionType4)
               parseMetadataStar(;)
                 listener: beginMetadataStar(const)
@@ -410,7 +407,7 @@
                   listener: endRedirectingFactoryBody(=, ;)
                 listener: endExtensionTypeFactoryMethod(const, factory, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.ExtensionType, ExtensionType4)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -436,7 +433,7 @@
                   listener: handleRecoverableError(ExtensionTypeDeclaresInstanceField, field, field)
                 listener: endExtensionTypeFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.ExtensionType, ExtensionType4)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -468,7 +465,6 @@
                           parsePrimary(=>, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(=>, expression, ConstantPatternContext.none)
                               parseSend(=>, expression, ConstantPatternContext.none)
-                                isNextIdentifier(=>)
                                 ensureIdentifier(=>, expression)
                                   listener: handleIdentifier(it, expression)
                                 listener: handleNoTypeArguments(;)
@@ -480,7 +476,7 @@
                     inGenerator()
                 listener: endExtensionTypeMethod(get, int, =>, null, ;)
               listener: endMember()
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.ExtensionType, ExtensionType4)
               parseMetadataStar(;)
                 listener: beginMetadataStar(void)
@@ -519,11 +515,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endExtensionTypeMethod(set, void, (, null, })
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.ExtensionType, ExtensionType4)
               parseMetadataStar(})
                 listener: beginMetadataStar(int)
@@ -558,7 +554,6 @@
                           parsePrimary(=>, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(=>, expression, ConstantPatternContext.none)
                               parseSend(=>, expression, ConstantPatternContext.none)
-                                isNextIdentifier(=>)
                                 ensureIdentifier(=>, expression)
                                   listener: handleIdentifier(it, expression)
                                 listener: handleNoTypeArguments(;)
@@ -570,7 +565,7 @@
                     inGenerator()
                 listener: endExtensionTypeMethod(null, int, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.ExtensionType, ExtensionType4)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -616,7 +611,6 @@
                           parsePrimary(=>, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(=>, expression, ConstantPatternContext.none)
                               parseSend(=>, expression, ConstantPatternContext.none)
-                                isNextIdentifier(=>)
                                 ensureIdentifier(=>, expression)
                                   listener: handleIdentifier(it, expression)
                                 listener: handleNoTypeArguments(;)
@@ -628,7 +622,7 @@
                     inGenerator()
                 listener: endExtensionTypeMethod(null, int, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.ExtensionType, ExtensionType4)
               parseMetadataStar(;)
                 listener: beginMetadataStar(void)
@@ -678,11 +672,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endExtensionTypeMethod(null, void, (, null, })
               listener: endMember()
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.ExtensionType, ExtensionType4)
               parseMetadataStar(})
                 listener: beginMetadataStar(static)
@@ -706,7 +700,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endExtensionTypeFields(null, null, null, static, null, null, null, 1, static, ;)
               listener: endMember()
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.ExtensionType, ExtensionType4)
               parseMetadataStar(;)
                 listener: beginMetadataStar(static)
@@ -742,7 +736,7 @@
                     inGenerator()
                 listener: endExtensionTypeMethod(get, static, =>, null, ;)
               listener: endMember()
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.ExtensionType, ExtensionType4)
               parseMetadataStar(;)
                 listener: beginMetadataStar(static)
@@ -780,11 +774,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, false)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endExtensionTypeMethod(set, static, (, null, })
               listener: endMember()
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.ExtensionType, ExtensionType4)
               parseMetadataStar(})
                 listener: beginMetadataStar(static)
@@ -823,7 +817,7 @@
                     inGenerator()
                 listener: endExtensionTypeMethod(null, static, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 14, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
@@ -863,7 +857,7 @@
             listener: handleImplements(null, 0)
           parseClassOrMixinOrExtensionBody(), DeclarationKind.ExtensionType, ExtensionType5)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 0, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
@@ -901,7 +895,7 @@
             listener: handleImplements(null, 0)
           parseClassOrMixinOrExtensionBody(), DeclarationKind.ExtensionType, ExtensionType6)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 0, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
@@ -951,7 +945,7 @@
             listener: handleImplements(null, 0)
           parseClassOrMixinOrExtensionBody(), DeclarationKind.ExtensionType, ExtensionType7)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 0, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/inline_class/extension_type_missing_name.dart.intertwined.expect b/pkg/front_end/parser_testcases/inline_class/extension_type_missing_name.dart.intertwined.expect
index fb99806..f7bcf26 100644
--- a/pkg/front_end/parser_testcases/inline_class/extension_type_missing_name.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/inline_class/extension_type_missing_name.dart.intertwined.expect
@@ -38,7 +38,7 @@
             listener: handleImplements(null, 0)
           parseClassOrMixinOrExtensionBody(), DeclarationKind.ExtensionType, )
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 0, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
@@ -78,7 +78,7 @@
             listener: handleImplements(null, 0)
           parseClassOrMixinOrExtensionBody(), DeclarationKind.ExtensionType, )
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 0, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
@@ -120,7 +120,7 @@
             listener: handleImplements(null, 0)
           parseClassOrMixinOrExtensionBody(), DeclarationKind.ExtensionType, )
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 0, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
@@ -162,7 +162,7 @@
             listener: handleImplements(null, 0)
           parseClassOrMixinOrExtensionBody(), DeclarationKind.ExtensionType, )
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 0, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
@@ -210,7 +210,7 @@
             listener: handleImplements(null, 0)
           parseClassOrMixinOrExtensionBody(), DeclarationKind.ExtensionType, )
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 0, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
@@ -258,7 +258,7 @@
             listener: handleImplements(null, 0)
           parseClassOrMixinOrExtensionBody(), DeclarationKind.ExtensionType, )
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 0, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
@@ -308,7 +308,7 @@
             listener: handleImplements(null, 0)
           parseClassOrMixinOrExtensionBody(), DeclarationKind.ExtensionType, )
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 0, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
@@ -358,7 +358,7 @@
             listener: handleImplements(null, 0)
           parseClassOrMixinOrExtensionBody(), DeclarationKind.ExtensionType, )
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 0, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/inline_class/extension_type_on.dart.intertwined.expect b/pkg/front_end/parser_testcases/inline_class/extension_type_on.dart.intertwined.expect
index 4ebc5d3..6064549 100644
--- a/pkg/front_end/parser_testcases/inline_class/extension_type_on.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/inline_class/extension_type_on.dart.intertwined.expect
@@ -34,7 +34,7 @@
             listener: handleImplements(null, 0)
           parseClassOrMixinOrExtensionBody(), DeclarationKind.ExtensionType, on)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 0, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
@@ -70,7 +70,7 @@
             listener: handleImplements(null, 0)
           parseClassOrMixinOrExtensionBody(), DeclarationKind.ExtensionType, on)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 0, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
@@ -118,7 +118,7 @@
             listener: handleImplements(null, 0)
           parseClassOrMixinOrExtensionBody(), DeclarationKind.ExtensionType, on)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 0, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
@@ -162,7 +162,7 @@
             listener: handleImplements(null, 0)
           parseClassOrMixinOrExtensionBody(), DeclarationKind.ExtensionType, on)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 0, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/inline_class/inline_class.dart.intertwined.expect b/pkg/front_end/parser_testcases/inline_class/inline_class.dart.intertwined.expect
index 93683f3..27b1e07 100644
--- a/pkg/front_end/parser_testcases/inline_class/inline_class.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/inline_class/inline_class.dart.intertwined.expect
@@ -48,7 +48,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Class, DeclarationKind.Class, Class)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/inline_class/no_body.dart.intertwined.expect b/pkg/front_end/parser_testcases/inline_class/no_body.dart.intertwined.expect
index e0188eb9..553401b 100644
--- a/pkg/front_end/parser_testcases/inline_class/no_body.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/inline_class/no_body.dart.intertwined.expect
@@ -46,7 +46,7 @@
               rewriter()
           parseClassOrMixinOrExtensionBody(C, DeclarationKind.Class, C)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -95,7 +95,7 @@
             rewriter()
         parseClassOrMixinOrExtensionBody(M, DeclarationKind.Mixin, M)
           listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Mixin, {)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endClassOrMixinOrExtensionBody(DeclarationKind.Mixin, 0, {, })
         listener: endMixinDeclaration(mixin, })
   listener: endTopLevelDeclaration(})
@@ -130,7 +130,7 @@
               rewriter()
           parseClassOrMixinOrExtensionBody(int, DeclarationKind.Extension, E)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Extension, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Extension, 0, {, })
           listener: endExtensionDeclaration(extension, extension, on, })
   listener: endTopLevelDeclaration(})
@@ -194,7 +194,7 @@
               rewriter()
           parseClassOrMixinOrExtensionBody(), DeclarationKind.ExtensionType, ET1)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 0, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
@@ -261,7 +261,7 @@
               rewriter()
           parseClassOrMixinOrExtensionBody(Foo, DeclarationKind.ExtensionType, ET2)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 0, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
@@ -331,7 +331,7 @@
               rewriter()
           parseClassOrMixinOrExtensionBody(Bar, DeclarationKind.ExtensionType, ET3)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 0, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/inline_class/no_primary_constructor.dart.intertwined.expect b/pkg/front_end/parser_testcases/inline_class/no_primary_constructor.dart.intertwined.expect
index 594d9ab..d4c60a5 100644
--- a/pkg/front_end/parser_testcases/inline_class/no_primary_constructor.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/inline_class/no_primary_constructor.dart.intertwined.expect
@@ -19,7 +19,7 @@
             listener: handleImplements(null, 0)
           parseClassOrMixinOrExtensionBody(ET1, DeclarationKind.ExtensionType, ET1)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 0, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
@@ -43,7 +43,7 @@
             listener: handleImplements(implements, 1)
           parseClassOrMixinOrExtensionBody(Foo, DeclarationKind.ExtensionType, ET2)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 0, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
@@ -70,7 +70,7 @@
             listener: handleImplements(implements, 2)
           parseClassOrMixinOrExtensionBody(Bar, DeclarationKind.ExtensionType, ET3)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 0, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
@@ -99,7 +99,7 @@
             listener: handleImplements(null, 0)
           parseClassOrMixinOrExtensionBody(>, DeclarationKind.ExtensionType, ET4)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 0, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
@@ -131,7 +131,7 @@
             listener: handleImplements(implements, 1)
           parseClassOrMixinOrExtensionBody(Foo, DeclarationKind.ExtensionType, ET5)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 0, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
@@ -166,7 +166,7 @@
             listener: handleImplements(implements, 2)
           parseClassOrMixinOrExtensionBody(Bar, DeclarationKind.ExtensionType, ET6)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 0, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
@@ -199,7 +199,7 @@
             listener: handleImplements(null, 0)
           parseClassOrMixinOrExtensionBody(name, DeclarationKind.ExtensionType, ET7)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 0, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
@@ -235,7 +235,7 @@
             listener: handleImplements(implements, 1)
           parseClassOrMixinOrExtensionBody(Foo, DeclarationKind.ExtensionType, ET8)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 0, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
@@ -274,7 +274,7 @@
             listener: handleImplements(implements, 2)
           parseClassOrMixinOrExtensionBody(Bar, DeclarationKind.ExtensionType, ET9)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.ExtensionType, 0, {, })
           listener: endExtensionTypeDeclaration(extension, null, extension, type, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/macros/augment_class.dart.intertwined.expect b/pkg/front_end/parser_testcases/macros/augment_class.dart.intertwined.expect
index 346f0df..f183c4d 100644
--- a/pkg/front_end/parser_testcases/macros/augment_class.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/macros/augment_class.dart.intertwined.expect
@@ -48,7 +48,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Class, DeclarationKind.Class, Class)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -100,7 +100,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Class, DeclarationKind.Class, Class)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/macros/macro_class.dart.intertwined.expect b/pkg/front_end/parser_testcases/macros/macro_class.dart.intertwined.expect
index d7f79d2..8185f59 100644
--- a/pkg/front_end/parser_testcases/macros/macro_class.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/macros/macro_class.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(macro, class, null)
           parseClassOrMixinOrExtensionBody(Class, DeclarationKind.Class, Class)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(macro, })
   listener: endTopLevelDeclaration(})
@@ -52,7 +52,7 @@
             listener: handleClassHeader(abstract, class, null)
           parseClassOrMixinOrExtensionBody(Class, DeclarationKind.Class, Class)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(abstract, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/chained_call_01.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/chained_call_01.dart.intertwined.expect
index 1a2ca3a..534ed91 100644
--- a/pkg/front_end/parser_testcases/nnbd/chained_call_01.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/chained_call_01.dart.intertwined.expect
@@ -37,7 +37,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, e)
+          notEofOrType(CLOSE_CURLY_BRACKET, e)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -49,7 +49,6 @@
                         parsePrimary({, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(e, expression)
                               listener: handleNoTypeArguments(!)
@@ -75,7 +74,7 @@
                       listener: handleNonNullAssertExpression(!)
                   ensureSemicolon(!)
                   listener: handleExpressionStatement(e, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/chained_call_02.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/chained_call_02.dart.intertwined.expect
index 01e8b94..95c6362 100644
--- a/pkg/front_end/parser_testcases/nnbd/chained_call_02.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/chained_call_02.dart.intertwined.expect
@@ -37,7 +37,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, e)
+          notEofOrType(CLOSE_CURLY_BRACKET, e)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -49,7 +49,6 @@
                         parsePrimary({, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(e, expression)
                               listener: handleNoTypeArguments(!)
@@ -78,7 +77,7 @@
                       listener: handleNonNullAssertExpression(!)
                   ensureSemicolon(!)
                   listener: handleExpressionStatement(e, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/chained_call_03.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/chained_call_03.dart.intertwined.expect
index d4200e2..5b2ec4c 100644
--- a/pkg/front_end/parser_testcases/nnbd/chained_call_03.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/chained_call_03.dart.intertwined.expect
@@ -37,7 +37,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, e)
+          notEofOrType(CLOSE_CURLY_BRACKET, e)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -49,7 +49,6 @@
                         parsePrimary({, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(e, expression)
                               listener: handleNoTypeArguments(!)
@@ -60,7 +59,6 @@
                       parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                         parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                           parseSend(., expressionContinuation, ConstantPatternContext.none)
-                            isNextIdentifier(.)
                             ensureIdentifier(., expressionContinuation)
                               listener: handleIdentifier(f, expressionContinuation)
                             listener: handleNoTypeArguments(!)
@@ -87,7 +85,7 @@
                       listener: handleNonNullAssertExpression(!)
                   ensureSemicolon(!)
                   listener: handleExpressionStatement(e, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/chained_call_04.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/chained_call_04.dart.intertwined.expect
index 779878e..53c21f1 100644
--- a/pkg/front_end/parser_testcases/nnbd/chained_call_04.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/chained_call_04.dart.intertwined.expect
@@ -37,7 +37,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, e)
+          notEofOrType(CLOSE_CURLY_BRACKET, e)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -49,7 +49,6 @@
                         parsePrimary({, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(e, expression)
                               listener: handleNoTypeArguments(!)
@@ -60,7 +59,6 @@
                       parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                         parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                           parseSend(., expressionContinuation, ConstantPatternContext.none)
-                            isNextIdentifier(.)
                             ensureIdentifier(., expressionContinuation)
                               listener: handleIdentifier(f, expressionContinuation)
                             listener: handleNoTypeArguments(!)
@@ -90,7 +88,7 @@
                       listener: handleNonNullAssertExpression(!)
                   ensureSemicolon(!)
                   listener: handleExpressionStatement(e, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/chained_call_05.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/chained_call_05.dart.intertwined.expect
index 225f30b..7b16aec 100644
--- a/pkg/front_end/parser_testcases/nnbd/chained_call_05.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/chained_call_05.dart.intertwined.expect
@@ -37,7 +37,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -57,7 +57,6 @@
                                       parsePrimary((, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                           parseSend((, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(()
                                             ensureIdentifier((, expression)
                                               listener: handleIdentifier(e, expression)
                                             listener: handleNoTypeArguments(!)
@@ -89,7 +88,7 @@
                         listener: handleNonNullAssertExpression(!)
                     ensureSemicolon(!)
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -109,7 +108,6 @@
                                       parsePrimary((, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                           parseSend((, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(()
                                             ensureIdentifier((, expression)
                                               listener: handleIdentifier(e, expression)
                                             listener: handleNoTypeArguments(!)
@@ -141,7 +139,7 @@
                         listener: handleNonNullAssertExpression(!)
                     ensureSemicolon(!)
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/chained_call_06.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/chained_call_06.dart.intertwined.expect
index d8a74b2..4e41f3d 100644
--- a/pkg/front_end/parser_testcases/nnbd/chained_call_06.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/chained_call_06.dart.intertwined.expect
@@ -37,7 +37,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -57,7 +57,6 @@
                                       parsePrimary((, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                           parseSend((, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(()
                                             ensureIdentifier((, expression)
                                               listener: handleIdentifier(e, expression)
                                             listener: handleNoTypeArguments(!)
@@ -68,7 +67,6 @@
                                     parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                         parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                          isNextIdentifier(.)
                                           ensureIdentifier(., expressionContinuation)
                                             listener: handleIdentifier(f, expressionContinuation)
                                           listener: handleNoTypeArguments(()
@@ -95,7 +93,7 @@
                           listener: handleSend((, ))
                     ensureSemicolon())
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -115,7 +113,6 @@
                                       parsePrimary((, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                           parseSend((, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(()
                                             ensureIdentifier((, expression)
                                               listener: handleIdentifier(e, expression)
                                             listener: handleNoTypeArguments(!)
@@ -126,7 +123,6 @@
                                     parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                         parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                          isNextIdentifier(.)
                                           ensureIdentifier(., expressionContinuation)
                                             listener: handleIdentifier(f, expressionContinuation)
                                           listener: handleNoTypeArguments(()
@@ -153,7 +149,7 @@
                           listener: handleSend((, ))
                     ensureSemicolon())
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/chained_call_07.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/chained_call_07.dart.intertwined.expect
index 17e3c69..e7bb5ea 100644
--- a/pkg/front_end/parser_testcases/nnbd/chained_call_07.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/chained_call_07.dart.intertwined.expect
@@ -37,7 +37,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, e)
+          notEofOrType(CLOSE_CURLY_BRACKET, e)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -49,7 +49,6 @@
                         parsePrimary({, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(e, expression)
                               listener: handleNoTypeArguments(!)
@@ -60,7 +59,6 @@
                       parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                         parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                           parseSend(., expressionContinuation, ConstantPatternContext.none)
-                            isNextIdentifier(.)
                             ensureIdentifier(., expressionContinuation)
                               listener: handleIdentifier(f, expressionContinuation)
                             listener: handleNoTypeArguments(!)
@@ -105,7 +103,7 @@
                       listener: handleNonNullAssertExpression(!)
                   ensureSemicolon(!)
                   listener: handleExpressionStatement(e, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/chained_call_08.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/chained_call_08.dart.intertwined.expect
index dfd3a915..6be6dc2 100644
--- a/pkg/front_end/parser_testcases/nnbd/chained_call_08.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/chained_call_08.dart.intertwined.expect
@@ -37,7 +37,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, e)
+          notEofOrType(CLOSE_CURLY_BRACKET, e)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -49,7 +49,6 @@
                         parsePrimary({, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(e, expression)
                               listener: handleNoTypeArguments(!)
@@ -60,7 +59,6 @@
                       parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                         parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                           parseSend(., expressionContinuation, ConstantPatternContext.none)
-                            isNextIdentifier(.)
                             ensureIdentifier(., expressionContinuation)
                               listener: handleIdentifier(f, expressionContinuation)
                             listener: handleNoTypeArguments(!)
@@ -101,7 +99,7 @@
                       listener: handleNonNullAssertExpression(!)
                   ensureSemicolon(!)
                   listener: handleExpressionStatement(e, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/chained_call_with_index_01.dart.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/chained_call_with_index_01.dart.dart.intertwined.expect
index ecbd58b..9f38bd2 100644
--- a/pkg/front_end/parser_testcases/nnbd/chained_call_with_index_01.dart.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/chained_call_with_index_01.dart.dart.intertwined.expect
@@ -37,7 +37,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, e)
+          notEofOrType(CLOSE_CURLY_BRACKET, e)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -49,7 +49,6 @@
                         parsePrimary({, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(e, expression)
                               listener: handleNoTypeArguments([)
@@ -63,7 +62,6 @@
                               parsePrimary([, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                   parseSend([, expression, ConstantPatternContext.none)
-                                    isNextIdentifier([)
                                     ensureIdentifier([, expression)
                                       listener: handleIdentifier(e, expression)
                                     listener: handleNoTypeArguments(])
@@ -85,7 +83,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(e, expression)
                                         listener: handleNoTypeArguments())
@@ -96,7 +93,7 @@
                         listener: handleSend([, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(e, ;)
-          notEofOrValue(}, e)
+          notEofOrType(CLOSE_CURLY_BRACKET, e)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -108,7 +105,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(e, expression)
                               listener: handleNoTypeArguments(!)
@@ -123,7 +119,6 @@
                               parsePrimary([, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                   parseSend([, expression, ConstantPatternContext.none)
-                                    isNextIdentifier([)
                                     ensureIdentifier([, expression)
                                       listener: handleIdentifier(e, expression)
                                     listener: handleNoTypeArguments(!)
@@ -147,7 +142,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(e, expression)
                                         listener: handleNoTypeArguments(!)
@@ -160,7 +154,7 @@
                       listener: handleNonNullAssertExpression(!)
                   ensureSemicolon(!)
                   listener: handleExpressionStatement(e, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/error_recovery/abstract_placement.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/error_recovery/abstract_placement.dart.intertwined.expect
index ca4da46..f572545 100644
--- a/pkg/front_end/parser_testcases/nnbd/error_recovery/abstract_placement.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/error_recovery/abstract_placement.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(abstract, class, null)
           parseClassOrMixinOrExtensionBody(C, DeclarationKind.Class, C)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, C)
               parseMetadataStar({)
                 listener: beginMetadataStar(final)
@@ -46,7 +46,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(abstract, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, C)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -65,7 +65,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(abstract, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, covariant)
+            notEofOrType(CLOSE_CURLY_BRACKET, covariant)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, C)
               parseMetadataStar(;)
                 listener: beginMetadataStar(covariant)
@@ -84,7 +84,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(abstract, null, null, null, covariant, null, null, 1, covariant, ;)
               listener: endMember()
-            notEofOrValue(}, covariant)
+            notEofOrType(CLOSE_CURLY_BRACKET, covariant)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, C)
               parseMetadataStar(;)
                 listener: beginMetadataStar(covariant)
@@ -103,7 +103,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(abstract, null, null, null, covariant, null, var, 1, covariant, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, C)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -122,7 +122,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(abstract, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, var)
+            notEofOrType(CLOSE_CURLY_BRACKET, var)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, C)
               parseMetadataStar(;)
                 listener: beginMetadataStar(var)
@@ -141,7 +141,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(abstract, null, null, null, null, null, var, 1, var, ;)
               listener: endMember()
-            notEofOrValue(}, C)
+            notEofOrType(CLOSE_CURLY_BRACKET, C)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, C)
               parseMetadataStar(;)
                 listener: beginMetadataStar(C)
@@ -162,7 +162,7 @@
                   rewriter()
                 listener: endClassFields(null, null, null, null, null, null, null, 1, C, ;)
               listener: endMember()
-            notEofOrValue(}, i7)
+            notEofOrType(CLOSE_CURLY_BRACKET, i7)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, C)
               parseMetadataStar(;)
                 listener: beginMetadataStar(i7)
@@ -180,7 +180,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, i7, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 8, {, })
           listener: endClassDeclaration(abstract, })
   listener: endTopLevelDeclaration(})
@@ -228,7 +228,7 @@
             listener: handleClassHeader(abstract, class, null)
           parseClassOrMixinOrExtensionBody(Bar, DeclarationKind.Class, Bar)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, covariant)
+            notEofOrType(CLOSE_CURLY_BRACKET, covariant)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Bar)
               parseMetadataStar({)
                 listener: beginMetadataStar(covariant)
@@ -250,7 +250,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, null, covariant, null, null, 1, covariant, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(abstract, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/error_recovery/external_placement.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/error_recovery/external_placement.dart.intertwined.expect
index a790c3b..99a4442 100644
--- a/pkg/front_end/parser_testcases/nnbd/error_recovery/external_placement.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/error_recovery/external_placement.dart.intertwined.expect
@@ -65,7 +65,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(C, DeclarationKind.Class, C)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, covariant)
+            notEofOrType(CLOSE_CURLY_BRACKET, covariant)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, C)
               parseMetadataStar({)
                 listener: beginMetadataStar(covariant)
@@ -84,7 +84,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, external, null, covariant, null, null, 1, covariant, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, C)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -105,7 +105,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, external, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, C)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -124,7 +124,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, external, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, C)
               parseMetadataStar(;)
                 listener: beginMetadataStar(static)
@@ -143,7 +143,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, external, static, null, null, final, 1, static, ;)
               listener: endMember()
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, C)
               parseMetadataStar(;)
                 listener: beginMetadataStar(static)
@@ -162,7 +162,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, external, static, null, null, final, 1, static, ;)
               listener: endMember()
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, C)
               parseMetadataStar(;)
                 listener: beginMetadataStar(final)
@@ -183,7 +183,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, external, static, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 6, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/error_recovery/late_without_var_etc.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/error_recovery/late_without_var_etc.dart.intertwined.expect
index 5693cb0..7da2d95 100644
--- a/pkg/front_end/parser_testcases/nnbd/error_recovery/late_without_var_etc.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/error_recovery/late_without_var_etc.dart.intertwined.expect
@@ -25,7 +25,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, late)
+          notEofOrType(CLOSE_CURLY_BRACKET, late)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -47,7 +47,7 @@
                       listener: endInitializedIdentifier(x)
                     ensureSemicolon(x)
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -92,7 +92,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Foo, DeclarationKind.Class, Foo)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, late)
+            notEofOrType(CLOSE_CURLY_BRACKET, late)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Foo)
               parseMetadataStar({)
                 listener: beginMetadataStar(late)
@@ -110,7 +110,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, null, null, late, null, 1, late, ;)
               listener: endMember()
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(void)
@@ -137,7 +137,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, late)
+                  notEofOrType(CLOSE_CURLY_BRACKET, late)
                   parseStatement({)
                     parseStatementX({)
                       parseExpressionStatementOrDeclaration({, null)
@@ -159,11 +159,11 @@
                               listener: endInitializedIdentifier(x)
                             ensureSemicolon(x)
                             listener: endVariablesDeclaration(1, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(null, void, (, null, })
               listener: endMember()
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(static)
@@ -189,7 +189,7 @@
                   inPlainSync()
                 parseFunctionBody(), false, false)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, late)
+                  notEofOrType(CLOSE_CURLY_BRACKET, late)
                   parseStatement({)
                     parseStatementX({)
                       parseExpressionStatementOrDeclaration({, null)
@@ -211,11 +211,11 @@
                               listener: endInitializedIdentifier(x)
                             ensureSemicolon(x)
                             listener: endVariablesDeclaration(1, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(null, static, (, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 3, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/issue_39286.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/issue_39286.dart.intertwined.expect
index 3d62fcf..8a6a58c 100644
--- a/pkg/front_end/parser_testcases/nnbd/issue_39286.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/issue_39286.dart.intertwined.expect
@@ -37,7 +37,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, x)
+          notEofOrType(CLOSE_CURLY_BRACKET, x)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -49,7 +49,6 @@
                         parsePrimary({, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(x, expression)
                               listener: handleNoTypeArguments(..)
@@ -59,7 +58,6 @@
                       parseCascadeExpression(x)
                         listener: beginCascade(..)
                         parseSend(.., expressionContinuation, ConstantPatternContext.none)
-                          isNextIdentifier(..)
                           ensureIdentifier(.., expressionContinuation)
                             listener: handleIdentifier(f, expressionContinuation)
                           listener: handleNoTypeArguments(()
@@ -73,7 +71,6 @@
                         listener: handleNonNullAssertExpression(!)
                         parseArgumentOrIndexStar(!, NoTypeParamOrArg(), false)
                         parseSend(., expressionContinuation, ConstantPatternContext.none)
-                          isNextIdentifier(.)
                           ensureIdentifier(., expressionContinuation)
                             listener: handleIdentifier(g, expressionContinuation)
                           listener: handleNoTypeArguments(()
@@ -90,7 +87,6 @@
                       parseCascadeExpression())
                         listener: beginCascade(..)
                         parseSend(.., expressionContinuation, ConstantPatternContext.none)
-                          isNextIdentifier(..)
                           ensureIdentifier(.., expressionContinuation)
                             listener: handleIdentifier(h, expressionContinuation)
                           listener: handleNoTypeArguments(()
@@ -105,7 +101,7 @@
                         listener: endCascade()
                   ensureSemicolon())
                   listener: handleExpressionStatement(x, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/issue_39286_2.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/issue_39286_2.dart.intertwined.expect
index 9a937c6..d0def53 100644
--- a/pkg/front_end/parser_testcases/nnbd/issue_39286_2.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/issue_39286_2.dart.intertwined.expect
@@ -37,7 +37,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, x)
+          notEofOrType(CLOSE_CURLY_BRACKET, x)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -49,7 +49,6 @@
                         parsePrimary({, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(x, expression)
                               listener: handleNoTypeArguments(..)
@@ -59,7 +58,6 @@
                       parseCascadeExpression(x)
                         listener: beginCascade(..)
                         parseSend(.., expressionContinuation, ConstantPatternContext.none)
-                          isNextIdentifier(..)
                           ensureIdentifier(.., expressionContinuation)
                             listener: handleIdentifier(f, expressionContinuation)
                           listener: handleNoTypeArguments(()
@@ -73,7 +71,6 @@
                         listener: handleNonNullAssertExpression(!)
                         parseArgumentOrIndexStar(!, NoTypeParamOrArg(), false)
                         parseSend(., expressionContinuation, ConstantPatternContext.none)
-                          isNextIdentifier(.)
                           ensureIdentifier(., expressionContinuation)
                             listener: handleIdentifier(g, expressionContinuation)
                           listener: handleNoTypeArguments(()
@@ -101,7 +98,6 @@
                       parseCascadeExpression(!)
                         listener: beginCascade(..)
                         parseSend(.., expressionContinuation, ConstantPatternContext.none)
-                          isNextIdentifier(..)
                           ensureIdentifier(.., expressionContinuation)
                             listener: handleIdentifier(h, expressionContinuation)
                           listener: handleNoTypeArguments(()
@@ -115,7 +111,6 @@
                         listener: handleNonNullAssertExpression(!)
                         parseArgumentOrIndexStar(!, NoTypeParamOrArg(), false)
                         parseSend(., expressionContinuation, ConstantPatternContext.none)
-                          isNextIdentifier(.)
                           ensureIdentifier(., expressionContinuation)
                             listener: handleIdentifier(y, expressionContinuation)
                           listener: handleNoTypeArguments(=)
@@ -135,7 +130,7 @@
                         listener: endCascade()
                   ensureSemicolon(2)
                   listener: handleExpressionStatement(x, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/issue_39286_2_prime.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/issue_39286_2_prime.dart.intertwined.expect
index a6de974..8b9f88d 100644
--- a/pkg/front_end/parser_testcases/nnbd/issue_39286_2_prime.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/issue_39286_2_prime.dart.intertwined.expect
@@ -37,7 +37,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, x)
+          notEofOrType(CLOSE_CURLY_BRACKET, x)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -49,7 +49,6 @@
                         parsePrimary({, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(x, expression)
                               listener: handleNoTypeArguments(..)
@@ -59,7 +58,6 @@
                       parseCascadeExpression(x)
                         listener: beginCascade(..)
                         parseSend(.., expressionContinuation, ConstantPatternContext.none)
-                          isNextIdentifier(..)
                           ensureIdentifier(.., expressionContinuation)
                             listener: handleIdentifier(f, expressionContinuation)
                           listener: handleNoTypeArguments(()
@@ -71,7 +69,6 @@
                           listener: handleSend(f, ))
                         listener: handleEndingBinaryExpression(.., ))
                         parseSend(., expressionContinuation, ConstantPatternContext.none)
-                          isNextIdentifier(.)
                           ensureIdentifier(., expressionContinuation)
                             listener: handleIdentifier(g, expressionContinuation)
                           listener: handleNoTypeArguments(()
@@ -97,7 +94,6 @@
                       parseCascadeExpression(])
                         listener: beginCascade(..)
                         parseSend(.., expressionContinuation, ConstantPatternContext.none)
-                          isNextIdentifier(..)
                           ensureIdentifier(.., expressionContinuation)
                             listener: handleIdentifier(h, expressionContinuation)
                           listener: handleNoTypeArguments(()
@@ -109,7 +105,6 @@
                           listener: handleSend(h, ))
                         listener: handleEndingBinaryExpression(.., ))
                         parseSend(., expressionContinuation, ConstantPatternContext.none)
-                          isNextIdentifier(.)
                           ensureIdentifier(., expressionContinuation)
                             listener: handleIdentifier(y, expressionContinuation)
                           listener: handleNoTypeArguments(=)
@@ -129,7 +124,7 @@
                         listener: endCascade()
                   ensureSemicolon(2)
                   listener: handleExpressionStatement(x, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/issue_39286_prime.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/issue_39286_prime.dart.intertwined.expect
index 98a90fc..8392989 100644
--- a/pkg/front_end/parser_testcases/nnbd/issue_39286_prime.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/issue_39286_prime.dart.intertwined.expect
@@ -37,7 +37,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, x)
+          notEofOrType(CLOSE_CURLY_BRACKET, x)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -49,7 +49,6 @@
                         parsePrimary({, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(x, expression)
                               listener: handleNoTypeArguments(..)
@@ -59,7 +58,6 @@
                       parseCascadeExpression(x)
                         listener: beginCascade(..)
                         parseSend(.., expressionContinuation, ConstantPatternContext.none)
-                          isNextIdentifier(..)
                           ensureIdentifier(.., expressionContinuation)
                             listener: handleIdentifier(f, expressionContinuation)
                           listener: handleNoTypeArguments(()
@@ -71,7 +69,6 @@
                           listener: handleSend(f, ))
                         listener: handleEndingBinaryExpression(.., ))
                         parseSend(., expressionContinuation, ConstantPatternContext.none)
-                          isNextIdentifier(.)
                           ensureIdentifier(., expressionContinuation)
                             listener: handleIdentifier(g, expressionContinuation)
                           listener: handleNoTypeArguments(()
@@ -88,7 +85,6 @@
                       parseCascadeExpression())
                         listener: beginCascade(..)
                         parseSend(.., expressionContinuation, ConstantPatternContext.none)
-                          isNextIdentifier(..)
                           ensureIdentifier(.., expressionContinuation)
                             listener: handleIdentifier(h, expressionContinuation)
                           listener: handleNoTypeArguments(()
@@ -103,7 +99,7 @@
                         listener: endCascade()
                   ensureSemicolon())
                   listener: handleExpressionStatement(x, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/issue_39326.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/issue_39326.dart.intertwined.expect
index c3f6a9f..53ee7b4 100644
--- a/pkg/front_end/parser_testcases/nnbd/issue_39326.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/issue_39326.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
@@ -45,7 +45,7 @@
                     listener: endInitializedIdentifier(c)
                   ensureSemicolon(c)
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, c)
+          notEofOrType(CLOSE_CURLY_BRACKET, c)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -57,7 +57,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(c, expression)
                               listener: handleNoTypeArguments(?.)
@@ -83,7 +82,7 @@
                       listener: handleAssignmentExpression(=, 42)
                   ensureSemicolon(42)
                   listener: handleExpressionStatement(c, ;)
-          notEofOrValue(}, c)
+          notEofOrType(CLOSE_CURLY_BRACKET, c)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -95,7 +94,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(c, expression)
                               listener: handleNoTypeArguments(?)
@@ -133,7 +131,7 @@
                       listener: handleAssignmentExpression(=, 42)
                   ensureSemicolon(42)
                   listener: handleExpressionStatement(c, ;)
-          notEofOrValue(}, c)
+          notEofOrType(CLOSE_CURLY_BRACKET, c)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -145,7 +143,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(c, expression)
                               listener: handleNoTypeArguments(?)
@@ -183,7 +180,7 @@
                       listener: handleAssignmentExpression(=, 42)
                   ensureSemicolon(42)
                   listener: handleExpressionStatement(c, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(4, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/issue_39697.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/issue_39697.dart.intertwined.expect
index 2ac110a..9b2aedc 100644
--- a/pkg/front_end/parser_testcases/nnbd/issue_39697.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/issue_39697.dart.intertwined.expect
@@ -30,7 +30,6 @@
                   parsePrimary(=>, expression, ConstantPatternContext.none)
                     parseSendOrFunctionLiteral(=>, expression, ConstantPatternContext.none)
                       parseSend(=>, expression, ConstantPatternContext.none)
-                        isNextIdentifier(=>)
                         ensureIdentifier(=>, expression)
                           listener: handleIdentifier(Zone, expression)
                         listener: handleNoTypeArguments(.)
@@ -40,7 +39,6 @@
                 parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                   parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                     parseSend(., expressionContinuation, ConstantPatternContext.none)
-                      isNextIdentifier(.)
                       ensureIdentifier(., expressionContinuation)
                         listener: handleIdentifier(current, expressionContinuation)
                       listener: handleNoTypeArguments([)
@@ -55,7 +53,6 @@
                         parsePrimary([, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                             parseSend([, expression, ConstantPatternContext.none)
-                              isNextIdentifier([)
                               ensureIdentifier([, expression)
                                 listener: handleIdentifier(logKey, expression)
                               listener: handleNoTypeArguments(])
@@ -78,7 +75,6 @@
                     parsePrimary(??, expression, ConstantPatternContext.none)
                       parseSendOrFunctionLiteral(??, expression, ConstantPatternContext.none)
                         parseSend(??, expression, ConstantPatternContext.none)
-                          isNextIdentifier(??)
                           ensureIdentifier(??, expression)
                             listener: handleIdentifier(_default, expression)
                           listener: handleNoTypeArguments(;)
diff --git a/pkg/front_end/parser_testcases/nnbd/issue_39697_prime.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/issue_39697_prime.dart.intertwined.expect
index dafcf38..24dcb56 100644
--- a/pkg/front_end/parser_testcases/nnbd/issue_39697_prime.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/issue_39697_prime.dart.intertwined.expect
@@ -37,7 +37,6 @@
                               parsePrimary((, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                   parseSend((, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(()
                                     ensureIdentifier((, expression)
                                       listener: handleIdentifier(Zone, expression)
                                     listener: handleNoTypeArguments(.)
@@ -47,7 +46,6 @@
                             parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                 parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                  isNextIdentifier(.)
                                   ensureIdentifier(., expressionContinuation)
                                     listener: handleIdentifier(current, expressionContinuation)
                                   listener: handleNoTypeArguments([)
@@ -62,7 +60,6 @@
                                     parsePrimary([, expression, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                         parseSend([, expression, ConstantPatternContext.none)
-                                          isNextIdentifier([)
                                           ensureIdentifier([, expression)
                                             listener: handleIdentifier(logKey, expression)
                                           listener: handleNoTypeArguments(])
@@ -87,7 +84,6 @@
                     parsePrimary(??, expression, ConstantPatternContext.none)
                       parseSendOrFunctionLiteral(??, expression, ConstantPatternContext.none)
                         parseSend(??, expression, ConstantPatternContext.none)
-                          isNextIdentifier(??)
                           ensureIdentifier(??, expression)
                             listener: handleIdentifier(_default, expression)
                           listener: handleNoTypeArguments(;)
diff --git a/pkg/front_end/parser_testcases/nnbd/issue_39723.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/issue_39723.dart.intertwined.expect
index 8b2e15a..13551f0 100644
--- a/pkg/front_end/parser_testcases/nnbd/issue_39723.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/issue_39723.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(A, DeclarationKind.Class, A)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, operator)
+            notEofOrType(CLOSE_CURLY_BRACKET, operator)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, A)
               parseMetadataStar({)
                 listener: beginMetadataStar(operator)
@@ -69,7 +69,6 @@
                           parsePrimary(=>, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(=>, expression, ConstantPatternContext.none)
                               parseSend(=>, expression, ConstantPatternContext.none)
-                                isNextIdentifier(=>)
                                 ensureIdentifier(=>, expression)
                                   listener: handleIdentifier(index, expression)
                                 listener: handleNoTypeArguments(;)
@@ -81,7 +80,7 @@
                     inGenerator()
                 listener: endClassMethod(null, operator, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -109,7 +108,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, A)
+          notEofOrType(CLOSE_CURLY_BRACKET, A)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -142,7 +141,7 @@
                     listener: endInitializedIdentifier(a)
                   ensureSemicolon(null)
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, a)
+          notEofOrType(CLOSE_CURLY_BRACKET, a)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -154,7 +153,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(a, expression)
                               listener: handleNoTypeArguments(!)
@@ -165,7 +163,6 @@
                       parsePrimary(?., expressionContinuation, ConstantPatternContext.none)
                         parseSendOrFunctionLiteral(?., expressionContinuation, ConstantPatternContext.none)
                           parseSend(?., expressionContinuation, ConstantPatternContext.none)
-                            isNextIdentifier(?.)
                             ensureIdentifier(?., expressionContinuation)
                               listener: handleIdentifier(toString, expressionContinuation)
                             listener: handleNoTypeArguments(()
@@ -178,7 +175,7 @@
                       listener: handleEndingBinaryExpression(?., ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(a, ;)
-          notEofOrValue(}, a)
+          notEofOrType(CLOSE_CURLY_BRACKET, a)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -190,7 +187,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(a, expression)
                               listener: handleNoTypeArguments(!)
@@ -211,7 +207,7 @@
                       listener: handleEndingBinaryExpression(?., ])
                   ensureSemicolon(])
                   listener: handleExpressionStatement(a, ;)
-          notEofOrValue(}, a)
+          notEofOrType(CLOSE_CURLY_BRACKET, a)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -223,7 +219,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(a, expression)
                               listener: handleNoTypeArguments(!)
@@ -252,7 +247,7 @@
                         listener: handleIndexedExpression(?, [, ])
                   ensureSemicolon(])
                   listener: handleExpressionStatement(a, ;)
-          notEofOrValue(}, a)
+          notEofOrType(CLOSE_CURLY_BRACKET, a)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -264,7 +259,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(a, expression)
                               listener: handleNoTypeArguments(!)
@@ -293,7 +287,7 @@
                         listener: handleIndexedExpression(?, [, ])
                   ensureSemicolon(])
                   listener: handleExpressionStatement(a, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(5, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/issue_39723_prime.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/issue_39723_prime.dart.intertwined.expect
index c252bf5..a0d4113 100644
--- a/pkg/front_end/parser_testcases/nnbd/issue_39723_prime.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/issue_39723_prime.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(A, DeclarationKind.Class, A)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, operator)
+            notEofOrType(CLOSE_CURLY_BRACKET, operator)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, A)
               parseMetadataStar({)
                 listener: beginMetadataStar(operator)
@@ -69,7 +69,6 @@
                           parsePrimary(=>, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(=>, expression, ConstantPatternContext.none)
                               parseSend(=>, expression, ConstantPatternContext.none)
-                                isNextIdentifier(=>)
                                 ensureIdentifier(=>, expression)
                                   listener: handleIdentifier(index, expression)
                                 listener: handleNoTypeArguments(;)
@@ -81,7 +80,7 @@
                     inGenerator()
                 listener: endClassMethod(null, operator, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -109,7 +108,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, A)
+          notEofOrType(CLOSE_CURLY_BRACKET, A)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -142,7 +141,7 @@
                     listener: endInitializedIdentifier(a)
                   ensureSemicolon(null)
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -162,7 +161,6 @@
                                       parsePrimary((, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                           parseSend((, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(()
                                             ensureIdentifier((, expression)
                                               listener: handleIdentifier(a, expression)
                                             listener: handleNoTypeArguments(!)
@@ -175,7 +173,6 @@
                         parsePrimary(?., expressionContinuation, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(?., expressionContinuation, ConstantPatternContext.none)
                             parseSend(?., expressionContinuation, ConstantPatternContext.none)
-                              isNextIdentifier(?.)
                               ensureIdentifier(?., expressionContinuation)
                                 listener: handleIdentifier(toString, expressionContinuation)
                               listener: handleNoTypeArguments(()
@@ -188,7 +185,7 @@
                         listener: handleEndingBinaryExpression(?., ))
                     ensureSemicolon())
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -208,7 +205,6 @@
                                       parsePrimary((, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                           parseSend((, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(()
                                             ensureIdentifier((, expression)
                                               listener: handleIdentifier(a, expression)
                                             listener: handleNoTypeArguments(!)
@@ -231,7 +227,7 @@
                         listener: handleEndingBinaryExpression(?., ])
                     ensureSemicolon(])
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -251,7 +247,6 @@
                                       parsePrimary((, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                           parseSend((, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(()
                                             ensureIdentifier((, expression)
                                               listener: handleIdentifier(a, expression)
                                             listener: handleNoTypeArguments(!)
@@ -282,7 +277,7 @@
                           listener: handleIndexedExpression(?, [, ])
                     ensureSemicolon(])
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -302,7 +297,6 @@
                                       parsePrimary((, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                           parseSend((, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(()
                                             ensureIdentifier((, expression)
                                               listener: handleIdentifier(a, expression)
                                             listener: handleNoTypeArguments(!)
@@ -333,7 +327,7 @@
                           listener: handleIndexedExpression(?, [, ])
                     ensureSemicolon(])
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(5, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/issue_39776.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/issue_39776.dart.intertwined.expect
index 41e8eb5..aea1f4e 100644
--- a/pkg/front_end/parser_testcases/nnbd/issue_39776.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/issue_39776.dart.intertwined.expect
@@ -132,7 +132,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, Function)
+          notEofOrType(CLOSE_CURLY_BRACKET, Function)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -144,7 +144,6 @@
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               ensureIdentifier(=, expression)
                               parseArgumentsOpt(foo)
                   listener: beginMetadataStar(Function)
@@ -166,7 +165,6 @@
                               parsePrimary(=, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                   parseSend(=, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(=)
                                     ensureIdentifier(=, expression)
                                       listener: handleIdentifier(foo, expression)
                                     listener: handleNoTypeArguments(;)
@@ -177,7 +175,7 @@
                       listener: endInitializedIdentifier(f1)
                     ensureSemicolon(foo)
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, f1)
+          notEofOrType(CLOSE_CURLY_BRACKET, f1)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -189,7 +187,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(f1, expression)
                               listener: handleNoTypeArguments(!)
@@ -212,7 +209,7 @@
                         listener: handleSend((, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(f1, ;)
-          notEofOrValue(}, Function)
+          notEofOrType(CLOSE_CURLY_BRACKET, Function)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -237,7 +234,6 @@
                               parsePrimary(=, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                   parseSend(=, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(=)
                                     ensureIdentifier(=, expression)
                                       listener: handleIdentifier(bar, expression)
                                     listener: handleNoTypeArguments(;)
@@ -248,7 +244,7 @@
                       listener: endInitializedIdentifier(f2)
                     ensureSemicolon(bar)
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, f2)
+          notEofOrType(CLOSE_CURLY_BRACKET, f2)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -260,7 +256,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(f2, expression)
                               listener: handleNoTypeArguments(!)
@@ -287,7 +282,7 @@
                         listener: handleSend((, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(f2, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(4, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/issue_39776_prime1.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/issue_39776_prime1.dart.intertwined.expect
index b32b1c2..e878737 100644
--- a/pkg/front_end/parser_testcases/nnbd/issue_39776_prime1.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/issue_39776_prime1.dart.intertwined.expect
@@ -132,7 +132,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, Function)
+          notEofOrType(CLOSE_CURLY_BRACKET, Function)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -144,7 +144,6 @@
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               ensureIdentifier(=, expression)
                               parseArgumentsOpt(foo)
                   listener: beginMetadataStar(Function)
@@ -166,7 +165,6 @@
                               parsePrimary(=, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                   parseSend(=, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(=)
                                     ensureIdentifier(=, expression)
                                       listener: handleIdentifier(foo, expression)
                                     listener: handleNoTypeArguments(;)
@@ -177,7 +175,7 @@
                       listener: endInitializedIdentifier(f1)
                     ensureSemicolon(foo)
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, f1)
+          notEofOrType(CLOSE_CURLY_BRACKET, f1)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -189,7 +187,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(f1, expression)
                               listener: handleNoTypeArguments(!)
@@ -212,7 +209,7 @@
                         listener: handleSend((, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(f1, ;)
-          notEofOrValue(}, Function)
+          notEofOrType(CLOSE_CURLY_BRACKET, Function)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -237,7 +234,6 @@
                               parsePrimary(=, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                   parseSend(=, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(=)
                                     ensureIdentifier(=, expression)
                                       listener: handleIdentifier(bar, expression)
                                     listener: handleNoTypeArguments(;)
@@ -248,7 +244,7 @@
                       listener: endInitializedIdentifier(f2)
                     ensureSemicolon(bar)
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, f2)
+          notEofOrType(CLOSE_CURLY_BRACKET, f2)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -261,7 +257,6 @@
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(f2, expression)
                               listener: beginTypeArguments(<)
@@ -283,7 +278,7 @@
                               listener: handleSend(f2, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(f2, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(4, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/issue_39776_prime2.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/issue_39776_prime2.dart.intertwined.expect
index a9c9371..7cad011 100644
--- a/pkg/front_end/parser_testcases/nnbd/issue_39776_prime2.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/issue_39776_prime2.dart.intertwined.expect
@@ -132,7 +132,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, Function)
+          notEofOrType(CLOSE_CURLY_BRACKET, Function)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -144,7 +144,6 @@
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               ensureIdentifier(=, expression)
                               parseArgumentsOpt(foo)
                   listener: beginMetadataStar(Function)
@@ -166,7 +165,6 @@
                               parsePrimary(=, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                   parseSend(=, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(=)
                                     ensureIdentifier(=, expression)
                                       listener: handleIdentifier(foo, expression)
                                     listener: handleNoTypeArguments(;)
@@ -177,7 +175,7 @@
                       listener: endInitializedIdentifier(f1)
                     ensureSemicolon(foo)
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, f1)
+          notEofOrType(CLOSE_CURLY_BRACKET, f1)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -189,7 +187,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(f1, expression)
                               listener: handleNoTypeArguments(!)
@@ -212,7 +209,7 @@
                         listener: handleSend((, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(f1, ;)
-          notEofOrValue(}, Function)
+          notEofOrType(CLOSE_CURLY_BRACKET, Function)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -237,7 +234,6 @@
                               parsePrimary(=, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                   parseSend(=, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(=)
                                     ensureIdentifier(=, expression)
                                       listener: handleIdentifier(bar, expression)
                                     listener: handleNoTypeArguments(;)
@@ -248,7 +244,7 @@
                       listener: endInitializedIdentifier(f2)
                     ensureSemicolon(bar)
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -268,7 +264,6 @@
                                       parsePrimary((, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                           parseSend((, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(()
                                             ensureIdentifier((, expression)
                                               listener: handleIdentifier(f2, expression)
                                             listener: handleNoTypeArguments(!)
@@ -297,7 +292,7 @@
                           listener: handleSend((, ))
                     ensureSemicolon())
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(4, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/issue_39776_prime3.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/issue_39776_prime3.dart.intertwined.expect
index 3cba144..7475b15 100644
--- a/pkg/front_end/parser_testcases/nnbd/issue_39776_prime3.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/issue_39776_prime3.dart.intertwined.expect
@@ -104,7 +104,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, Function)
+          notEofOrType(CLOSE_CURLY_BRACKET, Function)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -129,7 +129,6 @@
                               parsePrimary(=, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                   parseSend(=, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(=)
                                     ensureIdentifier(=, expression)
                                       listener: handleIdentifier(bar, expression)
                                     listener: handleNoTypeArguments(;)
@@ -140,7 +139,7 @@
                       listener: endInitializedIdentifier(f2)
                     ensureSemicolon(bar)
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, f2)
+          notEofOrType(CLOSE_CURLY_BRACKET, f2)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -152,7 +151,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(f2, expression)
                               listener: handleNoTypeArguments(!)
@@ -190,7 +188,7 @@
                         listener: handleSend((, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(f2, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/issue_39776_prime4.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/issue_39776_prime4.dart.intertwined.expect
index 9164522..9cfcfa6 100644
--- a/pkg/front_end/parser_testcases/nnbd/issue_39776_prime4.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/issue_39776_prime4.dart.intertwined.expect
@@ -104,7 +104,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, Function)
+          notEofOrType(CLOSE_CURLY_BRACKET, Function)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -129,7 +129,6 @@
                               parsePrimary(=, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                   parseSend(=, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(=)
                                     ensureIdentifier(=, expression)
                                       listener: handleIdentifier(bar, expression)
                                     listener: handleNoTypeArguments(;)
@@ -140,7 +139,7 @@
                       listener: endInitializedIdentifier(f2)
                     ensureSemicolon(bar)
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, f2)
+          notEofOrType(CLOSE_CURLY_BRACKET, f2)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -153,7 +152,6 @@
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(f2, expression)
                               listener: beginTypeArguments(<)
@@ -186,7 +184,7 @@
                               listener: handleSend(f2, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(f2, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/issue_39858.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/issue_39858.dart.intertwined.expect
index 154fa6b..413bf76 100644
--- a/pkg/front_end/parser_testcases/nnbd/issue_39858.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/issue_39858.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(X, DeclarationKind.Class, X)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, late)
+            notEofOrType(CLOSE_CURLY_BRACKET, late)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, X)
               parseMetadataStar({)
                 listener: beginMetadataStar(late)
@@ -43,7 +43,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, null, null, late, null, 1, late, ;)
               listener: endMember()
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, X)
               parseMetadataStar(;)
                 listener: beginMetadataStar(static)
@@ -61,7 +61,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, static, null, late, null, 1, static, ;)
               listener: endMember()
-            notEofOrValue(}, covariant)
+            notEofOrType(CLOSE_CURLY_BRACKET, covariant)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, X)
               parseMetadataStar(;)
                 listener: beginMetadataStar(covariant)
@@ -79,7 +79,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, null, covariant, late, null, 1, covariant, ;)
               listener: endMember()
-            notEofOrValue(}, late)
+            notEofOrType(CLOSE_CURLY_BRACKET, late)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, X)
               parseMetadataStar(;)
                 listener: beginMetadataStar(late)
@@ -104,7 +104,7 @@
                   listener: endFieldInitializer(=, 0)
                 listener: endClassFields(null, null, null, null, null, late, null, 1, late, ;)
               listener: endMember()
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, X)
               parseMetadataStar(;)
                 listener: beginMetadataStar(static)
@@ -129,7 +129,7 @@
                   listener: endFieldInitializer(=, 0)
                 listener: endClassFields(null, null, null, static, null, late, null, 1, static, ;)
               listener: endMember()
-            notEofOrValue(}, covariant)
+            notEofOrType(CLOSE_CURLY_BRACKET, covariant)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, X)
               parseMetadataStar(;)
                 listener: beginMetadataStar(covariant)
@@ -154,7 +154,7 @@
                   listener: endFieldInitializer(=, 0)
                 listener: endClassFields(null, null, null, null, covariant, late, null, 1, covariant, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 6, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/issue_39858_prime1.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/issue_39858_prime1.dart.intertwined.expect
index 75dcec2..2bab511 100644
--- a/pkg/front_end/parser_testcases/nnbd/issue_39858_prime1.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/issue_39858_prime1.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(X, DeclarationKind.Class, X)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, var)
+            notEofOrType(CLOSE_CURLY_BRACKET, var)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, X)
               parseMetadataStar({)
                 listener: beginMetadataStar(var)
@@ -42,7 +42,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, null, null, null, var, 1, var, ;)
               listener: endMember()
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, X)
               parseMetadataStar(;)
                 listener: beginMetadataStar(static)
@@ -59,7 +59,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, static, null, null, var, 1, static, ;)
               listener: endMember()
-            notEofOrValue(}, covariant)
+            notEofOrType(CLOSE_CURLY_BRACKET, covariant)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, X)
               parseMetadataStar(;)
                 listener: beginMetadataStar(covariant)
@@ -76,7 +76,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, null, covariant, null, var, 1, covariant, ;)
               listener: endMember()
-            notEofOrValue(}, var)
+            notEofOrType(CLOSE_CURLY_BRACKET, var)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, X)
               parseMetadataStar(;)
                 listener: beginMetadataStar(var)
@@ -100,7 +100,7 @@
                   listener: endFieldInitializer(=, 0)
                 listener: endClassFields(null, null, null, null, null, null, var, 1, var, ;)
               listener: endMember()
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, X)
               parseMetadataStar(;)
                 listener: beginMetadataStar(static)
@@ -124,7 +124,7 @@
                   listener: endFieldInitializer(=, 0)
                 listener: endClassFields(null, null, null, static, null, null, var, 1, static, ;)
               listener: endMember()
-            notEofOrValue(}, covariant)
+            notEofOrType(CLOSE_CURLY_BRACKET, covariant)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, X)
               parseMetadataStar(;)
                 listener: beginMetadataStar(covariant)
@@ -148,7 +148,7 @@
                   listener: endFieldInitializer(=, 0)
                 listener: endClassFields(null, null, null, null, covariant, null, var, 1, covariant, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 6, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/issue_40267_case_01.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/issue_40267_case_01.dart.intertwined.expect
index d7ab395..8fdc24b 100644
--- a/pkg/front_end/parser_testcases/nnbd/issue_40267_case_01.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/issue_40267_case_01.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -39,7 +39,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(a, expression)
                                 listener: handleNoTypeArguments())
@@ -51,7 +50,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parseExpression(case)
@@ -60,7 +59,6 @@
                         parsePrimary(case, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.none)
                             parseSend(case, expression, ConstantPatternContext.none)
-                              isNextIdentifier(case)
                               ensureIdentifier(case, expression)
                                 listener: handleIdentifier(b, expression)
                               listener: handleNoTypeArguments(?)
@@ -79,7 +77,6 @@
                                         parsePrimary([, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                             parseSend([, expression, ConstantPatternContext.none)
-                                              isNextIdentifier([)
                                               ensureIdentifier([, expression)
                                               parseArgumentsOpt(c)
                         parseExpressionWithoutCascade(:)
@@ -88,7 +85,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                     parseArgumentsOpt(d)
                       parseConditionalExpressionRest(b)
@@ -105,7 +101,6 @@
                                         parsePrimary([, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                             parseSend([, expression, ConstantPatternContext.none)
-                                              isNextIdentifier([)
                                               ensureIdentifier([, expression)
                                                 listener: handleIdentifier(c, expression)
                                               listener: handleNoTypeArguments(])
@@ -121,7 +116,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(d, expression)
                                     listener: handleNoTypeArguments(:)
@@ -146,7 +140,6 @@
                                   parsePrimary(:, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                       parseSend(:, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(:)
                                         ensureIdentifier(:, expression)
                                           listener: handleIdentifier(e, expression)
                                         listener: handleNoTypeArguments(;)
@@ -157,10 +150,10 @@
                             listener: handleExpressionStatement(e, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/issue_40267_case_02.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/issue_40267_case_02.dart.intertwined.expect
index b709f59..91602fb 100644
--- a/pkg/front_end/parser_testcases/nnbd/issue_40267_case_02.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/issue_40267_case_02.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -39,7 +39,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(a, expression)
                                 listener: handleNoTypeArguments())
@@ -51,7 +50,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parseExpression(case)
@@ -60,7 +59,6 @@
                         parsePrimary(case, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.none)
                             parseSend(case, expression, ConstantPatternContext.none)
-                              isNextIdentifier(case)
                               ensureIdentifier(case, expression)
                                 listener: handleIdentifier(b, expression)
                               listener: handleNoTypeArguments(?)
@@ -79,7 +77,6 @@
                                         parsePrimary([, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                             parseSend([, expression, ConstantPatternContext.none)
-                                              isNextIdentifier([)
                                               ensureIdentifier([, expression)
                                               parseArgumentsOpt(c)
                         parseExpressionWithoutCascade(:)
@@ -98,7 +95,6 @@
                                                   parsePrimary({, expression, ConstantPatternContext.none)
                                                     inPlainSync()
                                                     parseSend({, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier({)
                                                       ensureIdentifier({, expression)
                                                         reportRecoverableErrorWithToken(break, Template(ExpectedIdentifier))
                                                         rewriter()
@@ -111,7 +107,6 @@
                               parsePrimary([, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                   parseSend([, expression, ConstantPatternContext.none)
-                                    isNextIdentifier([)
                                     ensureIdentifier([, expression)
                                       listener: handleIdentifier(c, expression)
                                     listener: handleNoTypeArguments(])
@@ -130,29 +125,29 @@
                         parseBlock(:, BlockKind(statement))
                           ensureBlock(:, BlockKind(statement))
                           listener: beginBlock({, BlockKind(statement))
-                          notEofOrValue(}, {)
+                          notEofOrType(CLOSE_CURLY_BRACKET, {)
                           parseStatement({)
                             parseStatementX({)
                               parseBlock({, BlockKind(statement))
                                 ensureBlock({, BlockKind(statement))
                                 listener: beginBlock({, BlockKind(statement))
-                                notEofOrValue(}, break)
+                                notEofOrType(CLOSE_CURLY_BRACKET, break)
                                 parseStatement({)
                                   parseStatementX({)
                                     parseBreakStatement({)
                                       isBreakAllowed()
                                       ensureSemicolon(break)
                                       listener: handleBreakStatement(false, break, ;)
-                                notEofOrValue(}, })
+                                notEofOrType(CLOSE_CURLY_BRACKET, })
                                 listener: endBlock(1, {, }, BlockKind(statement))
-                          notEofOrValue(}, })
+                          notEofOrType(CLOSE_CURLY_BRACKET, })
                           listener: endBlock(1, {, }, BlockKind(statement))
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, })
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/issue_40267_case_03.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/issue_40267_case_03.dart.intertwined.expect
index da0c699..06f6d96 100644
--- a/pkg/front_end/parser_testcases/nnbd/issue_40267_case_03.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/issue_40267_case_03.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -39,7 +39,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(a, expression)
                                 listener: handleNoTypeArguments())
@@ -51,7 +50,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parseExpression(case)
@@ -60,7 +59,6 @@
                         parsePrimary(case, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.none)
                             parseSend(case, expression, ConstantPatternContext.none)
-                              isNextIdentifier(case)
                               ensureIdentifier(case, expression)
                                 listener: handleIdentifier(x, expression)
                               listener: handleNoTypeArguments(?)
@@ -84,7 +82,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                     parseArgumentsOpt(baz)
                       parseConditionalExpressionRest(x)
@@ -110,7 +107,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(baz, expression)
                                     listener: handleNoTypeArguments(:)
@@ -132,10 +128,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/issue_40267_case_04.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/issue_40267_case_04.dart.intertwined.expect
index 4d65635..2ec7ce1 100644
--- a/pkg/front_end/parser_testcases/nnbd/issue_40267_case_04.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/issue_40267_case_04.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -39,7 +39,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(a, expression)
                                 listener: handleNoTypeArguments())
@@ -51,7 +50,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parseExpression(case)
@@ -60,7 +59,6 @@
                         parsePrimary(case, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.none)
                             parseSend(case, expression, ConstantPatternContext.none)
-                              isNextIdentifier(case)
                               ensureIdentifier(case, expression)
                                 listener: handleIdentifier(x, expression)
                               listener: handleNoTypeArguments(?)
@@ -159,10 +157,10 @@
                           listener: handleEmptyStatement(;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/issue_40267_case_05.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/issue_40267_case_05.dart.intertwined.expect
index e056467..04d87b1 100644
--- a/pkg/front_end/parser_testcases/nnbd/issue_40267_case_05.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/issue_40267_case_05.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -39,7 +39,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(a, expression)
                                 listener: handleNoTypeArguments())
@@ -51,7 +50,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parseExpression(case)
@@ -60,7 +59,6 @@
                         parsePrimary(case, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.none)
                             parseSend(case, expression, ConstantPatternContext.none)
-                              isNextIdentifier(case)
                               ensureIdentifier(case, expression)
                                 listener: handleIdentifier(x, expression)
                               listener: handleNoTypeArguments(?)
@@ -118,19 +116,19 @@
                         parseBlock(:, BlockKind(statement))
                           ensureBlock(:, BlockKind(statement))
                           listener: beginBlock({, BlockKind(statement))
-                          notEofOrValue(}, {)
+                          notEofOrType(CLOSE_CURLY_BRACKET, {)
                           parseStatement({)
                             parseStatementX({)
                               parseBlock({, BlockKind(statement))
                                 ensureBlock({, BlockKind(statement))
                                 listener: beginBlock({, BlockKind(statement))
-                                notEofOrValue(}, {)
+                                notEofOrType(CLOSE_CURLY_BRACKET, {)
                                 parseStatement({)
                                   parseStatementX({)
                                     parseBlock({, BlockKind(statement))
                                       ensureBlock({, BlockKind(statement))
                                       listener: beginBlock({, BlockKind(statement))
-                                      notEofOrValue(}, 2)
+                                      notEofOrType(CLOSE_CURLY_BRACKET, 2)
                                       parseStatement({)
                                         parseStatementX({)
                                           parseExpressionStatementOrDeclaration({, null)
@@ -145,11 +143,11 @@
                                                           listener: handleLiteralInt(2)
                                                 ensureSemicolon(2)
                                                 listener: handleExpressionStatement(2, ;)
-                                      notEofOrValue(}, })
+                                      notEofOrType(CLOSE_CURLY_BRACKET, })
                                       listener: endBlock(1, {, }, BlockKind(statement))
-                                notEofOrValue(}, })
+                                notEofOrType(CLOSE_CURLY_BRACKET, })
                                 listener: endBlock(1, {, }, BlockKind(statement))
-                          notEofOrValue(}, })
+                          notEofOrType(CLOSE_CURLY_BRACKET, })
                           listener: endBlock(1, {, }, BlockKind(statement))
                     peekPastLabels(;)
                     parseStatement(})
@@ -158,10 +156,10 @@
                           listener: handleEmptyStatement(;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 2, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/issue_40267_conditional.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/issue_40267_conditional.dart.intertwined.expect
index a37b754..9464764 100644
--- a/pkg/front_end/parser_testcases/nnbd/issue_40267_conditional.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/issue_40267_conditional.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
@@ -59,7 +59,7 @@
                     listener: endInitializedIdentifier(c)
                   ensureSemicolon(c)
                   listener: endVariablesDeclaration(3, ;)
-          notEofOrValue(}, a)
+          notEofOrType(CLOSE_CURLY_BRACKET, a)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -71,7 +71,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(a, expression)
                               listener: handleNoTypeArguments(?)
@@ -90,7 +89,6 @@
                                         parsePrimary([, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                             parseSend([, expression, ConstantPatternContext.none)
-                                              isNextIdentifier([)
                                               ensureIdentifier([, expression)
                                               parseArgumentsOpt(b)
                         parseExpressionWithoutCascade(:)
@@ -99,7 +97,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                     parseArgumentsOpt(c)
                       parseConditionalExpressionRest(a)
@@ -116,7 +113,6 @@
                                         parsePrimary([, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                             parseSend([, expression, ConstantPatternContext.none)
-                                              isNextIdentifier([)
                                               ensureIdentifier([, expression)
                                                 listener: handleIdentifier(b, expression)
                                               listener: handleNoTypeArguments(])
@@ -132,7 +128,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(c, expression)
                                     listener: handleNoTypeArguments(;)
@@ -142,7 +137,7 @@
                         listener: endConditionalExpression(?, :, c)
                   ensureSemicolon(c)
                   listener: handleExpressionStatement(a, ;)
-          notEofOrValue(}, a)
+          notEofOrType(CLOSE_CURLY_BRACKET, a)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -154,7 +149,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(a, expression)
                               listener: handleNoTypeArguments(?)
@@ -173,7 +167,6 @@
                                         parsePrimary([, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                             parseSend([, expression, ConstantPatternContext.none)
-                                              isNextIdentifier([)
                                               ensureIdentifier([, expression)
                                               parseArgumentsOpt(b)
                         parseExpressionWithoutCascade(:)
@@ -182,7 +175,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                     parseArgumentsOpt(c)
                       parseConditionalExpressionRest(a)
@@ -199,7 +191,6 @@
                                         parsePrimary([, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                             parseSend([, expression, ConstantPatternContext.none)
-                                              isNextIdentifier([)
                                               ensureIdentifier([, expression)
                                                 listener: handleIdentifier(b, expression)
                                               listener: handleNoTypeArguments(])
@@ -215,7 +206,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(c, expression)
                                     listener: handleNoTypeArguments(;)
@@ -225,7 +215,7 @@
                         listener: endConditionalExpression(?, :, c)
                   ensureSemicolon(c)
                   listener: handleExpressionStatement(a, ;)
-          notEofOrValue(}, a)
+          notEofOrType(CLOSE_CURLY_BRACKET, a)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -237,7 +227,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(a, expression)
                               listener: handleNoTypeArguments(?)
@@ -256,13 +245,11 @@
                                         parsePrimary([, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                             parseSend([, expression, ConstantPatternContext.none)
-                                              isNextIdentifier([)
                                               ensureIdentifier([, expression)
                                               parseArgumentsOpt(b)
                             parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                 parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                  isNextIdentifier(.)
                                   ensureIdentifier(., expressionContinuation)
                                   parseArgumentsOpt(toString)
                                     parseArguments(toString)
@@ -273,7 +260,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                     parseArgumentsOpt(c)
                       parseConditionalExpressionRest(a)
@@ -290,7 +276,6 @@
                                         parsePrimary([, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                             parseSend([, expression, ConstantPatternContext.none)
-                                              isNextIdentifier([)
                                               ensureIdentifier([, expression)
                                                 listener: handleIdentifier(b, expression)
                                               listener: handleNoTypeArguments(])
@@ -301,7 +286,6 @@
                             parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                 parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                  isNextIdentifier(.)
                                   ensureIdentifier(., expressionContinuation)
                                     listener: handleIdentifier(toString, expressionContinuation)
                                   listener: handleNoTypeArguments(()
@@ -320,7 +304,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(c, expression)
                                     listener: handleNoTypeArguments(;)
@@ -330,7 +313,7 @@
                         listener: endConditionalExpression(?, :, c)
                   ensureSemicolon(c)
                   listener: handleExpressionStatement(a, ;)
-          notEofOrValue(}, a)
+          notEofOrType(CLOSE_CURLY_BRACKET, a)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -342,7 +325,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(a, expression)
                               listener: handleNoTypeArguments(?)
@@ -361,13 +343,11 @@
                                         parsePrimary([, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                             parseSend([, expression, ConstantPatternContext.none)
-                                              isNextIdentifier([)
                                               ensureIdentifier([, expression)
                                               parseArgumentsOpt(b)
                             parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                 parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                  isNextIdentifier(.)
                                   ensureIdentifier(., expressionContinuation)
                                   parseArgumentsOpt(toString)
                                     parseArguments(toString)
@@ -378,7 +358,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                     parseArgumentsOpt(c)
                       parseConditionalExpressionRest(a)
@@ -395,7 +374,6 @@
                                         parsePrimary([, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                             parseSend([, expression, ConstantPatternContext.none)
-                                              isNextIdentifier([)
                                               ensureIdentifier([, expression)
                                                 listener: handleIdentifier(b, expression)
                                               listener: handleNoTypeArguments(])
@@ -406,7 +384,6 @@
                             parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                 parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                  isNextIdentifier(.)
                                   ensureIdentifier(., expressionContinuation)
                                     listener: handleIdentifier(toString, expressionContinuation)
                                   listener: handleNoTypeArguments(()
@@ -425,7 +402,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(c, expression)
                                     listener: handleNoTypeArguments(;)
@@ -435,7 +411,7 @@
                         listener: endConditionalExpression(?, :, c)
                   ensureSemicolon(c)
                   listener: handleExpressionStatement(a, ;)
-          notEofOrValue(}, a)
+          notEofOrType(CLOSE_CURLY_BRACKET, a)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -447,7 +423,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(a, expression)
                               listener: handleNoTypeArguments(?)
@@ -473,7 +448,6 @@
                                           parsePrimary([, expression, ConstantPatternContext.none)
                                             parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                               parseSend([, expression, ConstantPatternContext.none)
-                                                isNextIdentifier([)
                                                 ensureIdentifier([, expression)
                                                   listener: handleIdentifier(b, expression)
                                                 listener: handleNoTypeArguments(])
@@ -500,7 +474,6 @@
                                           parsePrimary([, expression, ConstantPatternContext.none)
                                             parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                               parseSend([, expression, ConstantPatternContext.none)
-                                                isNextIdentifier([)
                                                 ensureIdentifier([, expression)
                                                   listener: handleIdentifier(c, expression)
                                                 listener: handleNoTypeArguments(])
@@ -511,7 +484,7 @@
                         listener: endConditionalExpression(?, :, ])
                   ensureSemicolon(])
                   listener: handleExpressionStatement(a, ;)
-          notEofOrValue(}, a)
+          notEofOrType(CLOSE_CURLY_BRACKET, a)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -523,7 +496,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(a, expression)
                               listener: handleNoTypeArguments(?)
@@ -551,7 +523,6 @@
                                                     parsePrimary([, expression, ConstantPatternContext.none)
                                                       parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                                         parseSend([, expression, ConstantPatternContext.none)
-                                                          isNextIdentifier([)
                                                           ensureIdentifier([, expression)
                                                             listener: handleIdentifier(b, expression)
                                                           listener: handleNoTypeArguments(])
@@ -582,7 +553,6 @@
                                                     parsePrimary([, expression, ConstantPatternContext.none)
                                                       parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                                         parseSend([, expression, ConstantPatternContext.none)
-                                                          isNextIdentifier([)
                                                           ensureIdentifier([, expression)
                                                             listener: handleIdentifier(c, expression)
                                                           listener: handleNoTypeArguments(])
@@ -595,7 +565,7 @@
                         listener: endConditionalExpression(?, :, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(a, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(7, {, })
         listener: endTopLevelMethod(f, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/issue_40267_conditional_2.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/issue_40267_conditional_2.dart.intertwined.expect
index 137857a..7c9c5ba 100644
--- a/pkg/front_end/parser_testcases/nnbd/issue_40267_conditional_2.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/issue_40267_conditional_2.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
@@ -52,7 +52,7 @@
                     listener: endInitializedIdentifier(b)
                   ensureSemicolon(b)
                   listener: endVariablesDeclaration(2, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -63,7 +63,6 @@
                       parsePrimary(return, expression, ConstantPatternContext.none)
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               listener: handleIdentifier(a, expression)
                             listener: handleNoTypeArguments(?)
@@ -83,7 +82,6 @@
                                         parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                           looksLikeFunctionBody(])
                                           parseSend([, expression, ConstantPatternContext.none)
-                                            isNextIdentifier([)
                                             ensureIdentifier([, expression)
                                             parseArgumentsOpt(b)
                                               parseArguments(b)
@@ -116,7 +114,6 @@
                                         parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                           looksLikeFunctionBody(])
                                           parseSend([, expression, ConstantPatternContext.none)
-                                            isNextIdentifier([)
                                             ensureIdentifier([, expression)
                                               listener: handleIdentifier(b, expression)
                                             listener: handleNoTypeArguments(()
@@ -149,7 +146,7 @@
                 ensureSemicolon(null)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(f, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/issue_40267_index_access.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/issue_40267_index_access.dart.intertwined.expect
index 49e02a2..c933eb9 100644
--- a/pkg/front_end/parser_testcases/nnbd/issue_40267_index_access.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/issue_40267_index_access.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
@@ -52,7 +52,7 @@
                     listener: endInitializedIdentifier(b)
                   ensureSemicolon(b)
                   listener: endVariablesDeclaration(2, ;)
-          notEofOrValue(}, a)
+          notEofOrType(CLOSE_CURLY_BRACKET, a)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -64,7 +64,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(a, expression)
                               listener: handleNoTypeArguments(?.)
@@ -80,7 +79,6 @@
                                 parsePrimary([, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                     parseSend([, expression, ConstantPatternContext.none)
-                                      isNextIdentifier([)
                                       ensureIdentifier([, expression)
                                         listener: handleIdentifier(b, expression)
                                       listener: handleNoTypeArguments(])
@@ -91,7 +89,7 @@
                       listener: handleEndingBinaryExpression(?., ])
                   ensureSemicolon(])
                   listener: handleExpressionStatement(a, ;)
-          notEofOrValue(}, a)
+          notEofOrType(CLOSE_CURLY_BRACKET, a)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -103,7 +101,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(a, expression)
                               listener: handleNoTypeArguments(?)
@@ -122,7 +119,6 @@
                                         parsePrimary([, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                             parseSend([, expression, ConstantPatternContext.none)
-                                              isNextIdentifier([)
                                               ensureIdentifier([, expression)
                                               parseArgumentsOpt(b)
                       parseArgumentOrIndexStar(a, NoTypeParamOrArg(), true)
@@ -132,7 +128,6 @@
                               parsePrimary([, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                   parseSend([, expression, ConstantPatternContext.none)
-                                    isNextIdentifier([)
                                     ensureIdentifier([, expression)
                                       listener: handleIdentifier(b, expression)
                                     listener: handleNoTypeArguments(])
@@ -142,7 +137,7 @@
                         listener: handleIndexedExpression(?, [, ])
                   ensureSemicolon(])
                   listener: handleExpressionStatement(a, ;)
-          notEofOrValue(}, a)
+          notEofOrType(CLOSE_CURLY_BRACKET, a)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -154,7 +149,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(a, expression)
                               listener: handleNoTypeArguments(?)
@@ -173,7 +167,6 @@
                                         parsePrimary([, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                             parseSend([, expression, ConstantPatternContext.none)
-                                              isNextIdentifier([)
                                               ensureIdentifier([, expression)
                                               parseArgumentsOpt(b)
                       parseArgumentOrIndexStar(a, NoTypeParamOrArg(), true)
@@ -183,7 +176,6 @@
                               parsePrimary([, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                   parseSend([, expression, ConstantPatternContext.none)
-                                    isNextIdentifier([)
                                     ensureIdentifier([, expression)
                                       listener: handleIdentifier(b, expression)
                                     listener: handleNoTypeArguments(])
@@ -193,7 +185,7 @@
                         listener: handleIndexedExpression(?, [, ])
                   ensureSemicolon(])
                   listener: handleExpressionStatement(a, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(4, {, })
         listener: endTopLevelMethod(f, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/issue_40267_index_set.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/issue_40267_index_set.dart.intertwined.expect
index 757e1b6b..245f5db 100644
--- a/pkg/front_end/parser_testcases/nnbd/issue_40267_index_set.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/issue_40267_index_set.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
@@ -59,7 +59,7 @@
                     listener: endInitializedIdentifier(c)
                   ensureSemicolon(c)
                   listener: endVariablesDeclaration(3, ;)
-          notEofOrValue(}, a)
+          notEofOrType(CLOSE_CURLY_BRACKET, a)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -71,7 +71,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(a, expression)
                               listener: handleNoTypeArguments(?.)
@@ -87,7 +86,6 @@
                                 parsePrimary([, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                     parseSend([, expression, ConstantPatternContext.none)
-                                      isNextIdentifier([)
                                       ensureIdentifier([, expression)
                                         listener: handleIdentifier(b, expression)
                                       listener: handleNoTypeArguments(])
@@ -101,7 +99,6 @@
                           parsePrimary(=, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                               parseSend(=, expression, ConstantPatternContext.none)
-                                isNextIdentifier(=)
                                 ensureIdentifier(=, expression)
                                   listener: handleIdentifier(c, expression)
                                 listener: handleNoTypeArguments(;)
@@ -111,7 +108,7 @@
                       listener: handleAssignmentExpression(=, c)
                   ensureSemicolon(c)
                   listener: handleExpressionStatement(a, ;)
-          notEofOrValue(}, a)
+          notEofOrType(CLOSE_CURLY_BRACKET, a)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -123,7 +120,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(a, expression)
                               listener: handleNoTypeArguments(?)
@@ -142,7 +138,6 @@
                                         parsePrimary([, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                             parseSend([, expression, ConstantPatternContext.none)
-                                              isNextIdentifier([)
                                               ensureIdentifier([, expression)
                                               parseArgumentsOpt(b)
                             parsePrecedenceExpression(=, 1, false, ConstantPatternContext.none)
@@ -150,7 +145,6 @@
                                 parsePrimary(=, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                     parseSend(=, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(=)
                                       ensureIdentifier(=, expression)
                                       parseArgumentsOpt(c)
                       parseArgumentOrIndexStar(a, NoTypeParamOrArg(), true)
@@ -160,7 +154,6 @@
                               parsePrimary([, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                   parseSend([, expression, ConstantPatternContext.none)
-                                    isNextIdentifier([)
                                     ensureIdentifier([, expression)
                                       listener: handleIdentifier(b, expression)
                                     listener: handleNoTypeArguments(])
@@ -173,7 +166,6 @@
                           parsePrimary(=, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                               parseSend(=, expression, ConstantPatternContext.none)
-                                isNextIdentifier(=)
                                 ensureIdentifier(=, expression)
                                   listener: handleIdentifier(c, expression)
                                 listener: handleNoTypeArguments(;)
@@ -183,7 +175,7 @@
                       listener: handleAssignmentExpression(=, c)
                   ensureSemicolon(c)
                   listener: handleExpressionStatement(a, ;)
-          notEofOrValue(}, a)
+          notEofOrType(CLOSE_CURLY_BRACKET, a)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -195,7 +187,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(a, expression)
                               listener: handleNoTypeArguments(?)
@@ -214,7 +205,6 @@
                                         parsePrimary([, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                             parseSend([, expression, ConstantPatternContext.none)
-                                              isNextIdentifier([)
                                               ensureIdentifier([, expression)
                                               parseArgumentsOpt(b)
                             parsePrecedenceExpression(=, 1, false, ConstantPatternContext.none)
@@ -222,7 +212,6 @@
                                 parsePrimary(=, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                     parseSend(=, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(=)
                                       ensureIdentifier(=, expression)
                                       parseArgumentsOpt(c)
                       parseArgumentOrIndexStar(a, NoTypeParamOrArg(), true)
@@ -232,7 +221,6 @@
                               parsePrimary([, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                   parseSend([, expression, ConstantPatternContext.none)
-                                    isNextIdentifier([)
                                     ensureIdentifier([, expression)
                                       listener: handleIdentifier(b, expression)
                                     listener: handleNoTypeArguments(])
@@ -245,7 +233,6 @@
                           parsePrimary(=, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                               parseSend(=, expression, ConstantPatternContext.none)
-                                isNextIdentifier(=)
                                 ensureIdentifier(=, expression)
                                   listener: handleIdentifier(c, expression)
                                 listener: handleNoTypeArguments(;)
@@ -255,7 +242,7 @@
                       listener: handleAssignmentExpression(=, c)
                   ensureSemicolon(c)
                   listener: handleExpressionStatement(a, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(4, {, })
         listener: endTopLevelMethod(f, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/issue_40267_lookup_plus.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/issue_40267_lookup_plus.dart.intertwined.expect
index f2dd0c1..e15fa54 100644
--- a/pkg/front_end/parser_testcases/nnbd/issue_40267_lookup_plus.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/issue_40267_lookup_plus.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, a)
+          notEofOrType(CLOSE_CURLY_BRACKET, a)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -50,7 +50,6 @@
                         parsePrimary({, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(a, expression)
                               listener: handleNoTypeArguments(?)
@@ -89,7 +88,7 @@
                       listener: endBinaryExpression(+, 1)
                   ensureSemicolon(1)
                   listener: handleExpressionStatement(a, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(f, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/issue_40267_lookup_plus_plus.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/issue_40267_lookup_plus_plus.dart.intertwined.expect
index 5aca708..794dfbd 100644
--- a/pkg/front_end/parser_testcases/nnbd/issue_40267_lookup_plus_plus.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/issue_40267_lookup_plus_plus.dart.intertwined.expect
@@ -50,7 +50,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, x)
+          notEofOrType(CLOSE_CURLY_BRACKET, x)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -62,7 +62,6 @@
                         parsePrimary({, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(x, expression)
                               listener: handleNoTypeArguments(?)
@@ -81,7 +80,6 @@
                                         parsePrimary([, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                             parseSend([, expression, ConstantPatternContext.none)
-                                              isNextIdentifier([)
                                               ensureIdentifier([, expression)
                                               parseArgumentsOpt(i)
                       parseArgumentOrIndexStar(x, NoTypeParamOrArg(), true)
@@ -91,7 +89,6 @@
                               parsePrimary([, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                   parseSend([, expression, ConstantPatternContext.none)
-                                    isNextIdentifier([)
                                     ensureIdentifier([, expression)
                                       listener: handleIdentifier(i, expression)
                                     listener: handleNoTypeArguments(])
@@ -102,7 +99,7 @@
                       listener: handleUnaryPostfixAssignmentExpression(++)
                   ensureSemicolon(++)
                   listener: handleExpressionStatement(x, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(f, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/issue_40267_method_call_no_type_arguments.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/issue_40267_method_call_no_type_arguments.dart.intertwined.expect
index 0f85616..7ddf8df3 100644
--- a/pkg/front_end/parser_testcases/nnbd/issue_40267_method_call_no_type_arguments.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/issue_40267_method_call_no_type_arguments.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
@@ -52,7 +52,7 @@
                     listener: endInitializedIdentifier(b)
                   ensureSemicolon(b)
                   listener: endVariablesDeclaration(2, ;)
-          notEofOrValue(}, a)
+          notEofOrType(CLOSE_CURLY_BRACKET, a)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -64,7 +64,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(a, expression)
                               listener: handleNoTypeArguments(?.)
@@ -74,7 +73,6 @@
                       parsePrimary(?., expressionContinuation, ConstantPatternContext.none)
                         parseSendOrFunctionLiteral(?., expressionContinuation, ConstantPatternContext.none)
                           parseSend(?., expressionContinuation, ConstantPatternContext.none)
-                            isNextIdentifier(?.)
                             ensureIdentifier(?., expressionContinuation)
                               listener: handleIdentifier(call, expressionContinuation)
                             listener: handleNoTypeArguments(()
@@ -88,7 +86,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(b, expression)
                                               listener: handleNoTypeArguments())
@@ -100,7 +97,7 @@
                       listener: handleEndingBinaryExpression(?., ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(a, ;)
-          notEofOrValue(}, a)
+          notEofOrType(CLOSE_CURLY_BRACKET, a)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -112,7 +109,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(a, expression)
                               listener: handleNoTypeArguments(?)
@@ -134,7 +130,6 @@
                                           parsePrimary((, expression, ConstantPatternContext.none)
                                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                               parseSend((, expression, ConstantPatternContext.none)
-                                                isNextIdentifier(()
                                                 ensureIdentifier((, expression)
                                                   listener: handleIdentifier(b, expression)
                                                 listener: handleNoTypeArguments())
@@ -154,7 +149,6 @@
                             parseUnaryExpression(:, false, ConstantPatternContext.none)
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSend(:, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(:)
                                   ensureIdentifier(:, expression)
                                     reportRecoverableErrorWithToken(;, Template(ExpectedIdentifier))
                                       listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got ';'., Try inserting an identifier before ';'., {lexeme: ;}], ;, ;)
@@ -167,7 +161,7 @@
                         listener: endConditionalExpression(?, :, )
                   ensureSemicolon()
                   listener: handleExpressionStatement(a, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(3, {, })
         listener: endTopLevelMethod(f, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/issue_40267_method_call_with_type_arguments.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/issue_40267_method_call_with_type_arguments.dart.intertwined.expect
index 96f6ccb..2bf0f77 100644
--- a/pkg/front_end/parser_testcases/nnbd/issue_40267_method_call_with_type_arguments.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/issue_40267_method_call_with_type_arguments.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
@@ -52,7 +52,7 @@
                     listener: endInitializedIdentifier(b)
                   ensureSemicolon(b)
                   listener: endVariablesDeclaration(2, ;)
-          notEofOrValue(}, a)
+          notEofOrType(CLOSE_CURLY_BRACKET, a)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -64,7 +64,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(a, expression)
                               listener: handleNoTypeArguments(?.)
@@ -74,7 +73,6 @@
                       parsePrimary(?., expressionContinuation, ConstantPatternContext.none)
                         parseSendOrFunctionLiteral(?., expressionContinuation, ConstantPatternContext.none)
                           parseSend(?., expressionContinuation, ConstantPatternContext.none)
-                            isNextIdentifier(?.)
                             ensureIdentifier(?., expressionContinuation)
                               listener: handleIdentifier(call, expressionContinuation)
                             listener: beginTypeArguments(<)
@@ -92,7 +90,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(b, expression)
                                               listener: handleNoTypeArguments())
@@ -104,7 +101,7 @@
                       listener: handleEndingBinaryExpression(?., ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(a, ;)
-          notEofOrValue(}, a)
+          notEofOrType(CLOSE_CURLY_BRACKET, a)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -116,7 +113,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(a, expression)
                               listener: handleNoTypeArguments(?)
@@ -178,7 +174,6 @@
                             parseUnaryExpression(:, false, ConstantPatternContext.none)
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSend(:, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(:)
                                   ensureIdentifier(:, expression)
                                     reportRecoverableErrorWithToken(}, Template(ExpectedIdentifier))
                                       listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got '}'., Try inserting an identifier before '}'., {lexeme: }}], }, })
@@ -194,7 +189,7 @@
                       listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], ;, ;)
                     rewriter()
                   listener: handleExpressionStatement(a, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(3, {, })
         listener: endTopLevelMethod(f, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/issue_40267_plus_plus_lookup.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/issue_40267_plus_plus_lookup.dart.intertwined.expect
index b3b69ac..ef49af8 100644
--- a/pkg/front_end/parser_testcases/nnbd/issue_40267_plus_plus_lookup.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/issue_40267_plus_plus_lookup.dart.intertwined.expect
@@ -50,7 +50,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, ++)
+          notEofOrType(CLOSE_CURLY_BRACKET, ++)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -65,7 +65,6 @@
                               parsePrimary(++, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(++, expression, ConstantPatternContext.none)
                                   parseSend(++, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(++)
                                     ensureIdentifier(++, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(?)
@@ -84,7 +83,6 @@
                                               parsePrimary([, expression, ConstantPatternContext.none)
                                                 parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                                   parseSend([, expression, ConstantPatternContext.none)
-                                                    isNextIdentifier([)
                                                     ensureIdentifier([, expression)
                                                     parseArgumentsOpt(i)
                             parseArgumentOrIndexStar(x, NoTypeParamOrArg(), true)
@@ -94,7 +92,6 @@
                                     parsePrimary([, expression, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                         parseSend([, expression, ConstantPatternContext.none)
-                                          isNextIdentifier([)
                                           ensureIdentifier([, expression)
                                             listener: handleIdentifier(i, expression)
                                           listener: handleNoTypeArguments(])
@@ -105,7 +102,7 @@
                           listener: handleUnaryPrefixAssignmentExpression(++)
                     ensureSemicolon(])
                     listener: handleExpressionStatement(++, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(f, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/issue_40793.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/issue_40793.dart.intertwined.expect
index bab1ac4..e58b3f2 100644
--- a/pkg/front_end/parser_testcases/nnbd/issue_40793.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/issue_40793.dart.intertwined.expect
@@ -37,7 +37,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -50,7 +50,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(sample, expression)
                                 listener: handleNoTypeArguments(.)
@@ -60,7 +59,6 @@
                         parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                             parseSend(., expressionContinuation, ConstantPatternContext.none)
-                              isNextIdentifier(.)
                               ensureIdentifier(., expressionContinuation)
                                 listener: handleIdentifier(value, expressionContinuation)
                               listener: handleNoTypeArguments(!)
@@ -84,7 +82,7 @@
                     parseBlock(), BlockKind(statement))
                       ensureBlock(), BlockKind(statement))
                       listener: beginBlock({, BlockKind(statement))
-                      notEofOrValue(}, print)
+                      notEofOrType(CLOSE_CURLY_BRACKET, print)
                       parseStatement({)
                         parseStatementX({)
                           parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -97,7 +95,6 @@
                                       parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                                         looksLikeFunctionBody(;)
                                         parseSend({, expression, ConstantPatternContext.none)
-                                          isNextIdentifier({)
                                           ensureIdentifier({, expression)
                                             listener: handleIdentifier(print, expression)
                                           listener: handleNoTypeArguments(()
@@ -117,11 +114,11 @@
                                           listener: handleSend(print, ))
                               ensureSemicolon())
                               listener: handleExpressionStatement(print, ;)
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlock(1, {, }, BlockKind(statement))
                 listener: endThenStatement({, })
                 listener: endIfStatement(if, null, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/issue_40793_prime.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/issue_40793_prime.dart.intertwined.expect
index fc4a8e6..d82510a 100644
--- a/pkg/front_end/parser_testcases/nnbd/issue_40793_prime.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/issue_40793_prime.dart.intertwined.expect
@@ -37,7 +37,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -57,7 +57,6 @@
                                       parsePrimary((, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                           parseSend((, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(()
                                             ensureIdentifier((, expression)
                                               listener: handleIdentifier(sample, expression)
                                             listener: handleNoTypeArguments(.)
@@ -67,7 +66,6 @@
                                     parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                         parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                          isNextIdentifier(.)
                                           ensureIdentifier(., expressionContinuation)
                                             listener: handleIdentifier(value, expressionContinuation)
                                           listener: handleNoTypeArguments(!)
@@ -93,7 +91,7 @@
                     parseBlock(), BlockKind(statement))
                       ensureBlock(), BlockKind(statement))
                       listener: beginBlock({, BlockKind(statement))
-                      notEofOrValue(}, print)
+                      notEofOrType(CLOSE_CURLY_BRACKET, print)
                       parseStatement({)
                         parseStatementX({)
                           parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -106,7 +104,6 @@
                                       parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                                         looksLikeFunctionBody(;)
                                         parseSend({, expression, ConstantPatternContext.none)
-                                          isNextIdentifier({)
                                           ensureIdentifier({, expression)
                                             listener: handleIdentifier(print, expression)
                                           listener: handleNoTypeArguments(()
@@ -126,11 +123,11 @@
                                           listener: handleSend(print, ))
                               ensureSemicolon())
                               listener: handleExpressionStatement(print, ;)
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlock(1, {, }, BlockKind(statement))
                 listener: endThenStatement({, })
                 listener: endIfStatement(if, null, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/issue_40793_prime2.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/issue_40793_prime2.dart.intertwined.expect
index c63c6bd..dace3d1 100644
--- a/pkg/front_end/parser_testcases/nnbd/issue_40793_prime2.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/issue_40793_prime2.dart.intertwined.expect
@@ -37,7 +37,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -57,7 +57,6 @@
                                       parsePrimary((, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                           parseSend((, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(()
                                             ensureIdentifier((, expression)
                                               listener: handleIdentifier(sample, expression)
                                             listener: handleNoTypeArguments(.)
@@ -67,7 +66,6 @@
                                     parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                         parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                          isNextIdentifier(.)
                                           ensureIdentifier(., expressionContinuation)
                                             listener: handleIdentifier(value, expressionContinuation)
                                           listener: handleNoTypeArguments())
@@ -92,7 +90,7 @@
                     parseBlock(), BlockKind(statement))
                       ensureBlock(), BlockKind(statement))
                       listener: beginBlock({, BlockKind(statement))
-                      notEofOrValue(}, print)
+                      notEofOrType(CLOSE_CURLY_BRACKET, print)
                       parseStatement({)
                         parseStatementX({)
                           parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -105,7 +103,6 @@
                                       parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                                         looksLikeFunctionBody(;)
                                         parseSend({, expression, ConstantPatternContext.none)
-                                          isNextIdentifier({)
                                           ensureIdentifier({, expression)
                                             listener: handleIdentifier(print, expression)
                                           listener: handleNoTypeArguments(()
@@ -125,11 +122,11 @@
                                           listener: handleSend(print, ))
                               ensureSemicolon())
                               listener: handleExpressionStatement(print, ;)
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlock(1, {, }, BlockKind(statement))
                 listener: endThenStatement({, })
                 listener: endIfStatement(if, null, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/issue_40793_prime3.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/issue_40793_prime3.dart.intertwined.expect
index 3b31892..7de1547 100644
--- a/pkg/front_end/parser_testcases/nnbd/issue_40793_prime3.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/issue_40793_prime3.dart.intertwined.expect
@@ -37,7 +37,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -50,7 +50,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(sample, expression)
                                 listener: handleNoTypeArguments(.)
@@ -60,7 +59,6 @@
                         parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                             parseSend(., expressionContinuation, ConstantPatternContext.none)
-                              isNextIdentifier(.)
                               ensureIdentifier(., expressionContinuation)
                                 listener: handleIdentifier(value, expressionContinuation)
                               listener: handleNoTypeArguments(<)
@@ -83,7 +81,7 @@
                     parseBlock(), BlockKind(statement))
                       ensureBlock(), BlockKind(statement))
                       listener: beginBlock({, BlockKind(statement))
-                      notEofOrValue(}, print)
+                      notEofOrType(CLOSE_CURLY_BRACKET, print)
                       parseStatement({)
                         parseStatementX({)
                           parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -96,7 +94,6 @@
                                       parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                                         looksLikeFunctionBody(;)
                                         parseSend({, expression, ConstantPatternContext.none)
-                                          isNextIdentifier({)
                                           ensureIdentifier({, expression)
                                             listener: handleIdentifier(print, expression)
                                           listener: handleNoTypeArguments(()
@@ -116,11 +113,11 @@
                                           listener: handleSend(print, ))
                               ensureSemicolon())
                               listener: handleExpressionStatement(print, ;)
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlock(1, {, }, BlockKind(statement))
                 listener: endThenStatement({, })
                 listener: endIfStatement(if, null, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/issue_40793_prime4.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/issue_40793_prime4.dart.intertwined.expect
index d372ebd..c774549 100644
--- a/pkg/front_end/parser_testcases/nnbd/issue_40793_prime4.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/issue_40793_prime4.dart.intertwined.expect
@@ -37,7 +37,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, e)
+          notEofOrType(CLOSE_CURLY_BRACKET, e)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -49,7 +49,6 @@
                         parsePrimary({, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(e, expression)
                               listener: handleNoTypeArguments(.)
@@ -59,7 +58,6 @@
                       parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                         parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                           parseSend(., expressionContinuation, ConstantPatternContext.none)
-                            isNextIdentifier(.)
                             ensureIdentifier(., expressionContinuation)
                               listener: handleIdentifier(x, expressionContinuation)
                             listener: handleNoTypeArguments(<)
@@ -76,7 +74,7 @@
                       listener: endBinaryExpression(<, 10)
                   ensureSemicolon(10)
                   listener: handleExpressionStatement(e, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/issue_40793_prime5.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/issue_40793_prime5.dart.intertwined.expect
index 34f112a..f39a39b 100644
--- a/pkg/front_end/parser_testcases/nnbd/issue_40793_prime5.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/issue_40793_prime5.dart.intertwined.expect
@@ -37,7 +37,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, e)
+          notEofOrType(CLOSE_CURLY_BRACKET, e)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -49,7 +49,6 @@
                         parsePrimary({, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(e, expression)
                               listener: handleNoTypeArguments(.)
@@ -59,7 +58,6 @@
                       parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                         parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                           parseSend(., expressionContinuation, ConstantPatternContext.none)
-                            isNextIdentifier(.)
                             ensureIdentifier(., expressionContinuation)
                               listener: handleIdentifier(x, expressionContinuation)
                             listener: handleNoTypeArguments(!)
@@ -77,7 +75,7 @@
                       listener: endBinaryExpression(<, 10)
                   ensureSemicolon(10)
                   listener: handleExpressionStatement(e, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/issue_40805_01.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/issue_40805_01.dart.intertwined.expect
index 91feb0c..38186c4 100644
--- a/pkg/front_end/parser_testcases/nnbd/issue_40805_01.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/issue_40805_01.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(C, DeclarationKind.Class, C)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, covariant)
+            notEofOrType(CLOSE_CURLY_BRACKET, covariant)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, C)
               parseMetadataStar({)
                 listener: beginMetadataStar(covariant)
@@ -44,7 +44,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, null, covariant, late, final, 1, covariant, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/issue_40805_02.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/issue_40805_02.dart.intertwined.expect
index 4e62780..10bfde6 100644
--- a/pkg/front_end/parser_testcases/nnbd/issue_40805_02.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/issue_40805_02.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(C, DeclarationKind.Class, C)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, covariant)
+            notEofOrType(CLOSE_CURLY_BRACKET, covariant)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, C)
               parseMetadataStar({)
                 listener: beginMetadataStar(covariant)
@@ -53,7 +53,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, late, final, 1, covariant, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/issue_40805_03.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/issue_40805_03.dart.intertwined.expect
index 836e581..972635e 100644
--- a/pkg/front_end/parser_testcases/nnbd/issue_40805_03.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/issue_40805_03.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(C, DeclarationKind.Class, C)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, covariant)
+            notEofOrType(CLOSE_CURLY_BRACKET, covariant)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, C)
               parseMetadataStar({)
                 listener: beginMetadataStar(covariant)
@@ -53,7 +53,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, final, 1, covariant, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/issue_40834_01.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/issue_40834_01.dart.intertwined.expect
index ddbe1e8..e33aca4 100644
--- a/pkg/front_end/parser_testcases/nnbd/issue_40834_01.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/issue_40834_01.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Foo, DeclarationKind.Class, Foo)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, String)
+            notEofOrType(CLOSE_CURLY_BRACKET, String)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Foo)
               parseMetadataStar({)
                 listener: beginMetadataStar(String)
@@ -42,7 +42,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, String, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -59,7 +59,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, Foo)
+            notEofOrType(CLOSE_CURLY_BRACKET, Foo)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(Foo)
@@ -103,7 +103,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(=)
@@ -115,7 +114,6 @@
                                 parsePrimary(=, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                     parseSend(=, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(=)
                                       ensureIdentifier(=, expression)
                                         listener: handleIdentifier(o, expression)
                                       listener: handleNoTypeArguments(as)
@@ -142,7 +140,6 @@
                               parsePrimary(,, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                   parseSend(,, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(,)
                                     ensureIdentifier(,, expression)
                                       listener: handleIdentifier(y, expression)
                                     listener: handleNoTypeArguments(=)
@@ -165,7 +162,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, Foo, (, :, ;)
               listener: endMember()
-            notEofOrValue(}, Foo)
+            notEofOrType(CLOSE_CURLY_BRACKET, Foo)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(Foo)
@@ -213,7 +210,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(y, expression)
                                     listener: handleNoTypeArguments(=)
@@ -225,7 +221,6 @@
                                 parsePrimary(=, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                     parseSend(=, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(=)
                                       ensureIdentifier(=, expression)
                                         listener: handleIdentifier(o, expression)
                                       listener: handleNoTypeArguments(is)
@@ -249,7 +244,6 @@
                                       parsePrimary(?, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral(?, expression, ConstantPatternContext.none)
                                           parseSend(?, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(?)
                                             ensureIdentifier(?, expression)
                                               listener: handleIdentifier(o, expression)
                                             listener: handleNoTypeArguments(.)
@@ -259,7 +253,6 @@
                                     parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                         parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                          isNextIdentifier(.)
                                           ensureIdentifier(., expressionContinuation)
                                             listener: handleIdentifier(length, expressionContinuation)
                                           listener: handleNoTypeArguments(:)
@@ -287,7 +280,6 @@
                               parsePrimary(,, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                   parseSend(,, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(,)
                                     ensureIdentifier(,, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(=)
@@ -310,7 +302,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, Foo, (, :, ;)
               listener: endMember()
-            notEofOrValue(}, Foo)
+            notEofOrType(CLOSE_CURLY_BRACKET, Foo)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(Foo)
@@ -358,7 +350,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(y, expression)
                                     listener: handleNoTypeArguments(=)
@@ -370,7 +361,6 @@
                                 parsePrimary(=, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                     parseSend(=, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(=)
                                       ensureIdentifier(=, expression)
                                         listener: handleIdentifier(o, expression)
                                       listener: handleNoTypeArguments(is)
@@ -394,7 +384,6 @@
                                       parsePrimary(?, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral(?, expression, ConstantPatternContext.none)
                                           parseSend(?, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(?)
                                             ensureIdentifier(?, expression)
                                               listener: handleIdentifier(o, expression)
                                             listener: handleNoTypeArguments(.)
@@ -404,7 +393,6 @@
                                     parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                         parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                          isNextIdentifier(.)
                                           ensureIdentifier(., expressionContinuation)
                                             listener: handleIdentifier(length, expressionContinuation)
                                           listener: handleNoTypeArguments(:)
@@ -432,7 +420,6 @@
                               parsePrimary(,, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                   parseSend(,, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(,)
                                     ensureIdentifier(,, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(=)
@@ -455,7 +442,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, Foo, (, :, ;)
               listener: endMember()
-            notEofOrValue(}, Foo)
+            notEofOrType(CLOSE_CURLY_BRACKET, Foo)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(Foo)
@@ -503,7 +490,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(y, expression)
                                     listener: handleNoTypeArguments(=)
@@ -515,7 +501,6 @@
                                 parsePrimary(=, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                     parseSend(=, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(=)
                                       ensureIdentifier(=, expression)
                                         listener: handleIdentifier(o, expression)
                                       listener: handleNoTypeArguments(as)
@@ -539,7 +524,6 @@
                                       parsePrimary(?, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral(?, expression, ConstantPatternContext.none)
                                           parseSend(?, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(?)
                                             ensureIdentifier(?, expression)
                                               listener: handleIdentifier(o, expression)
                                             listener: handleNoTypeArguments(.)
@@ -549,7 +533,6 @@
                                     parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                         parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                          isNextIdentifier(.)
                                           ensureIdentifier(., expressionContinuation)
                                             listener: handleIdentifier(length, expressionContinuation)
                                           listener: handleNoTypeArguments(:)
@@ -577,7 +560,6 @@
                               parsePrimary(,, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                   parseSend(,, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(,)
                                     ensureIdentifier(,, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(=)
@@ -600,7 +582,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, Foo, (, :, ;)
               listener: endMember()
-            notEofOrValue(}, Foo)
+            notEofOrType(CLOSE_CURLY_BRACKET, Foo)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(Foo)
@@ -648,7 +630,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(y, expression)
                                     listener: handleNoTypeArguments(=)
@@ -660,7 +641,6 @@
                                 parsePrimary(=, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                     parseSend(=, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(=)
                                       ensureIdentifier(=, expression)
                                         listener: handleIdentifier(o, expression)
                                       listener: handleNoTypeArguments(as)
@@ -684,7 +664,6 @@
                                       parsePrimary(?, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral(?, expression, ConstantPatternContext.none)
                                           parseSend(?, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(?)
                                             ensureIdentifier(?, expression)
                                               listener: handleIdentifier(o, expression)
                                             listener: handleNoTypeArguments(.)
@@ -694,7 +673,6 @@
                                     parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                         parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                          isNextIdentifier(.)
                                           ensureIdentifier(., expressionContinuation)
                                             listener: handleIdentifier(length, expressionContinuation)
                                           listener: handleNoTypeArguments(:)
@@ -722,7 +700,6 @@
                               parsePrimary(,, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                   parseSend(,, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(,)
                                     ensureIdentifier(,, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(=)
@@ -745,7 +722,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, Foo, (, :, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 7, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/issue_40834_02.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/issue_40834_02.dart.intertwined.expect
index 986d64f..46095ac 100644
--- a/pkg/front_end/parser_testcases/nnbd/issue_40834_02.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/issue_40834_02.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Foo, DeclarationKind.Class, Foo)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, String)
+            notEofOrType(CLOSE_CURLY_BRACKET, String)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Foo)
               parseMetadataStar({)
                 listener: beginMetadataStar(String)
@@ -42,7 +42,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, String, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -59,7 +59,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, Foo)
+            notEofOrType(CLOSE_CURLY_BRACKET, Foo)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(Foo)
@@ -103,7 +103,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(=)
@@ -115,7 +114,6 @@
                                 parsePrimary(=, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                     parseSend(=, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(=)
                                       ensureIdentifier(=, expression)
                                         listener: handleIdentifier(o, expression)
                                       listener: handleNoTypeArguments(as)
@@ -142,7 +140,6 @@
                               parsePrimary(,, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                   parseSend(,, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(,)
                                     ensureIdentifier(,, expression)
                                       listener: handleIdentifier(y, expression)
                                     listener: handleNoTypeArguments(=)
@@ -165,7 +162,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, Foo, (, :, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 3, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/issue_40834_03.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/issue_40834_03.dart.intertwined.expect
index 54fc07d..8fca372 100644
--- a/pkg/front_end/parser_testcases/nnbd/issue_40834_03.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/issue_40834_03.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Foo, DeclarationKind.Class, Foo)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, String)
+            notEofOrType(CLOSE_CURLY_BRACKET, String)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Foo)
               parseMetadataStar({)
                 listener: beginMetadataStar(String)
@@ -42,7 +42,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, String, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -59,7 +59,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, Foo)
+            notEofOrType(CLOSE_CURLY_BRACKET, Foo)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(Foo)
@@ -103,7 +103,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(=)
@@ -115,7 +114,6 @@
                                 parsePrimary(=, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                     parseSend(=, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(=)
                                       ensureIdentifier(=, expression)
                                         listener: handleIdentifier(o, expression)
                                       listener: handleNoTypeArguments(!=)
@@ -137,7 +135,6 @@
                                       parsePrimary(?, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral(?, expression, ConstantPatternContext.none)
                                           parseSend(?, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(?)
                                             ensureIdentifier(?, expression)
                                               listener: handleIdentifier(o, expression)
                                             listener: handleNoTypeArguments(as)
@@ -173,7 +170,6 @@
                               parsePrimary(,, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                   parseSend(,, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(,)
                                     ensureIdentifier(,, expression)
                                       listener: handleIdentifier(y, expression)
                                     listener: handleNoTypeArguments(=)
@@ -196,7 +192,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, Foo, (, :, ;)
               listener: endMember()
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(void)
@@ -235,7 +231,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -248,7 +244,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(is)
@@ -296,7 +291,7 @@
                             parseBlock(), BlockKind(statement))
                               ensureBlock(), BlockKind(statement))
                               listener: beginBlock({, BlockKind(statement))
-                              notEofOrValue(}, print)
+                              notEofOrType(CLOSE_CURLY_BRACKET, print)
                               parseStatement({)
                                 parseStatementX({)
                                   parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -309,7 +304,6 @@
                                               parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                                                 looksLikeFunctionBody(;)
                                                 parseSend({, expression, ConstantPatternContext.none)
-                                                  isNextIdentifier({)
                                                   ensureIdentifier({, expression)
                                                     listener: handleIdentifier(print, expression)
                                                   listener: handleNoTypeArguments(()
@@ -329,15 +323,15 @@
                                                   listener: handleSend(print, ))
                                       ensureSemicolon())
                                       listener: handleExpressionStatement(print, ;)
-                              notEofOrValue(}, })
+                              notEofOrType(CLOSE_CURLY_BRACKET, })
                               listener: endBlock(1, {, }, BlockKind(statement))
                         listener: endThenStatement({, })
                         listener: endIfStatement(if, null, })
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(null, void, (, null, })
               listener: endMember()
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(void)
@@ -376,7 +370,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, if)
+                  notEofOrType(CLOSE_CURLY_BRACKET, if)
                   parseStatement({)
                     parseStatementX({)
                       parseIfStatement({)
@@ -389,7 +383,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(x, expression)
                                         listener: handleNoTypeArguments(is)
@@ -437,7 +430,7 @@
                             parseBlock(), BlockKind(statement))
                               ensureBlock(), BlockKind(statement))
                               listener: beginBlock({, BlockKind(statement))
-                              notEofOrValue(}, print)
+                              notEofOrType(CLOSE_CURLY_BRACKET, print)
                               parseStatement({)
                                 parseStatementX({)
                                   parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -450,7 +443,6 @@
                                               parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                                                 looksLikeFunctionBody(;)
                                                 parseSend({, expression, ConstantPatternContext.none)
-                                                  isNextIdentifier({)
                                                   ensureIdentifier({, expression)
                                                     listener: handleIdentifier(print, expression)
                                                   listener: handleNoTypeArguments(()
@@ -470,15 +462,15 @@
                                                   listener: handleSend(print, ))
                                       ensureSemicolon())
                                       listener: handleExpressionStatement(print, ;)
-                              notEofOrValue(}, })
+                              notEofOrType(CLOSE_CURLY_BRACKET, })
                               listener: endBlock(1, {, }, BlockKind(statement))
                         listener: endThenStatement({, })
                         listener: endIfStatement(if, null, })
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(null, void, (, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 5, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/issue_41177.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/issue_41177.dart.intertwined.expect
index 929be32..da5be69 100644
--- a/pkg/front_end/parser_testcases/nnbd/issue_41177.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/issue_41177.dart.intertwined.expect
@@ -54,7 +54,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, a)
+          notEofOrType(CLOSE_CURLY_BRACKET, a)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -66,7 +66,6 @@
                         parsePrimary({, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(a, expression)
                               listener: handleNoTypeArguments(!)
@@ -84,7 +83,7 @@
                         listener: handleIndexedExpression(null, [, ])
                   ensureSemicolon(])
                   listener: handleExpressionStatement(a, ;)
-          notEofOrValue(}, a)
+          notEofOrType(CLOSE_CURLY_BRACKET, a)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -96,7 +95,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(a, expression)
                               listener: handleNoTypeArguments(?)
@@ -124,7 +122,7 @@
                         listener: handleIndexedExpression(?, [, ])
                   ensureSemicolon(])
                   listener: handleExpressionStatement(a, ;)
-          notEofOrValue(}, a)
+          notEofOrType(CLOSE_CURLY_BRACKET, a)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -136,7 +134,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(a, expression)
                               listener: handleNoTypeArguments(!)
@@ -165,7 +162,7 @@
                         listener: handleIndexedExpression(?, [, ])
                   ensureSemicolon(])
                   listener: handleExpressionStatement(a, ;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -185,7 +182,6 @@
                                       parsePrimary((, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                           parseSend((, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(()
                                             ensureIdentifier((, expression)
                                               listener: handleIdentifier(a, expression)
                                             listener: handleNoTypeArguments(!)
@@ -216,7 +212,7 @@
                           listener: handleIndexedExpression(?, [, ])
                     ensureSemicolon(])
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, b)
+          notEofOrType(CLOSE_CURLY_BRACKET, b)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -228,7 +224,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(b, expression)
                               listener: handleNoTypeArguments(!)
@@ -278,7 +273,7 @@
                         listener: endConditionalExpression(?, :, 0)
                   ensureSemicolon(0)
                   listener: handleExpressionStatement(b, ;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -298,7 +293,6 @@
                                       parsePrimary((, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                           parseSend((, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(()
                                             ensureIdentifier((, expression)
                                               listener: handleIdentifier(b, expression)
                                             listener: handleNoTypeArguments(!)
@@ -350,7 +344,7 @@
                           listener: endConditionalExpression(?, :, 0)
                     ensureSemicolon(0)
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(6, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/issue_41597.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/issue_41597.dart.intertwined.expect
index 5f523db..1597365 100644
--- a/pkg/front_end/parser_testcases/nnbd/issue_41597.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/issue_41597.dart.intertwined.expect
@@ -60,7 +60,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, print)
+          notEofOrType(CLOSE_CURLY_BRACKET, print)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -73,7 +73,6 @@
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(print, expression)
                               listener: handleNoTypeArguments(()
@@ -87,7 +86,6 @@
                                           parsePrimary((, expression, ConstantPatternContext.none)
                                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                               parseSend((, expression, ConstantPatternContext.none)
-                                                isNextIdentifier(()
                                                 ensureIdentifier((, expression)
                                                   listener: handleIdentifier(x, expression)
                                                 listener: handleNoTypeArguments())
@@ -98,7 +96,7 @@
                               listener: handleSend(print, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(print, ;)
-          notEofOrValue(}, print)
+          notEofOrType(CLOSE_CURLY_BRACKET, print)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -111,7 +109,6 @@
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(print, expression)
                               listener: handleNoTypeArguments(()
@@ -125,7 +122,6 @@
                                           parsePrimary((, expression, ConstantPatternContext.none)
                                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                               parseSend((, expression, ConstantPatternContext.none)
-                                                isNextIdentifier(()
                                                 ensureIdentifier((, expression)
                                                   listener: handleIdentifier(x, expression)
                                                 listener: handleNoTypeArguments(!)
@@ -137,7 +133,7 @@
                               listener: handleSend(print, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(print, ;)
-          notEofOrValue(}, print)
+          notEofOrType(CLOSE_CURLY_BRACKET, print)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -150,7 +146,6 @@
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(print, expression)
                               listener: handleNoTypeArguments(()
@@ -166,7 +161,6 @@
                                               parsePrimary(!, expression, ConstantPatternContext.none)
                                                 parseSendOrFunctionLiteral(!, expression, ConstantPatternContext.none)
                                                   parseSend(!, expression, ConstantPatternContext.none)
-                                                    isNextIdentifier(!)
                                                     ensureIdentifier(!, expression)
                                                       listener: handleIdentifier(x, expression)
                                                     listener: handleNoTypeArguments())
@@ -178,7 +172,7 @@
                               listener: handleSend(print, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(print, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(3, {, })
         listener: endTopLevelMethod(errors, null, })
   listener: endTopLevelDeclaration(})
@@ -205,7 +199,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(C, DeclarationKind.Class, C)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, C)
+            notEofOrType(CLOSE_CURLY_BRACKET, C)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, C)
               parseMetadataStar({)
                 listener: beginMetadataStar(C)
@@ -258,7 +252,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, C, (, :, ;)
               listener: endMember()
-            notEofOrValue(}, C)
+            notEofOrType(CLOSE_CURLY_BRACKET, C)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, C)
               parseMetadataStar(;)
                 listener: beginMetadataStar(C)
@@ -312,7 +306,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, C, (, :, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 2, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -340,7 +334,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/issue_42621.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/issue_42621.dart.intertwined.expect
index 5f90b39..4d501e0 100644
--- a/pkg/front_end/parser_testcases/nnbd/issue_42621.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/issue_42621.dart.intertwined.expect
@@ -47,7 +47,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement({)
             parseStatementX({)
               parseReturnStatement({)
@@ -59,7 +59,6 @@
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           looksLikeFunctionBody(..)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               listener: handleIdentifier(Order, expression)
                             listener: handleNoTypeArguments(()
@@ -72,7 +71,6 @@
                     parseCascadeExpression())
                       listener: beginCascade(..)
                       parseSend(.., expressionContinuation, ConstantPatternContext.none)
-                        isNextIdentifier(..)
                         ensureIdentifier(.., expressionContinuation)
                           listener: handleIdentifier(x, expressionContinuation)
                         listener: handleNoTypeArguments(=)
@@ -87,7 +85,6 @@
                             parsePrimary(=, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                 parseSend(=, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(=)
                                   ensureIdentifier(=, expression)
                                     listener: handleIdentifier(json, expression)
                                   listener: handleNoTypeArguments([)
@@ -118,7 +115,6 @@
                     parseCascadeExpression(List)
                       listener: beginCascade(..)
                       parseSend(.., expressionContinuation, ConstantPatternContext.none)
-                        isNextIdentifier(..)
                         ensureIdentifier(.., expressionContinuation)
                           listener: handleIdentifier(y, expressionContinuation)
                         listener: handleNoTypeArguments(=)
@@ -133,7 +129,6 @@
                             parsePrimary(=, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                 parseSend(=, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(=)
                                   ensureIdentifier(=, expression)
                                     listener: handleIdentifier(json, expression)
                                   listener: handleNoTypeArguments([)
@@ -164,7 +159,7 @@
                 ensureSemicolon(int)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(Order, null, })
   listener: endTopLevelDeclaration(})
@@ -213,7 +208,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement({)
             parseStatementX({)
               parseReturnStatement({)
@@ -225,7 +220,6 @@
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           looksLikeFunctionBody(..)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               listener: handleIdentifier(Order, expression)
                             listener: handleNoTypeArguments(()
@@ -238,7 +232,6 @@
                     parseCascadeExpression())
                       listener: beginCascade(..)
                       parseSend(.., expressionContinuation, ConstantPatternContext.none)
-                        isNextIdentifier(..)
                         ensureIdentifier(.., expressionContinuation)
                           listener: handleIdentifier(x, expressionContinuation)
                         listener: handleNoTypeArguments(=)
@@ -253,7 +246,6 @@
                             parsePrimary(=, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                 parseSend(=, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(=)
                                   ensureIdentifier(=, expression)
                                     listener: handleIdentifier(json, expression)
                                   listener: handleNoTypeArguments([)
@@ -284,7 +276,6 @@
                     parseCascadeExpression(?)
                       listener: beginCascade(..)
                       parseSend(.., expressionContinuation, ConstantPatternContext.none)
-                        isNextIdentifier(..)
                         ensureIdentifier(.., expressionContinuation)
                           listener: handleIdentifier(y, expressionContinuation)
                         listener: handleNoTypeArguments(=)
@@ -299,7 +290,6 @@
                             parsePrimary(=, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                 parseSend(=, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(=)
                                   ensureIdentifier(=, expression)
                                     listener: handleIdentifier(json, expression)
                                   listener: handleNoTypeArguments([)
@@ -330,7 +320,7 @@
                 ensureSemicolon(int)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(Order, null, })
   listener: endTopLevelDeclaration(})
@@ -379,7 +369,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement({)
             parseStatementX({)
               parseReturnStatement({)
@@ -391,7 +381,6 @@
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           looksLikeFunctionBody(..)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               listener: handleIdentifier(Order, expression)
                             listener: handleNoTypeArguments(()
@@ -404,7 +393,6 @@
                     parseCascadeExpression())
                       listener: beginCascade(..)
                       parseSend(.., expressionContinuation, ConstantPatternContext.none)
-                        isNextIdentifier(..)
                         ensureIdentifier(.., expressionContinuation)
                           listener: handleIdentifier(x, expressionContinuation)
                         listener: handleNoTypeArguments(=)
@@ -426,7 +414,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(json, expression)
                                               listener: handleNoTypeArguments([)
@@ -459,7 +446,6 @@
                     parseCascadeExpression())
                       listener: beginCascade(..)
                       parseSend(.., expressionContinuation, ConstantPatternContext.none)
-                        isNextIdentifier(..)
                         ensureIdentifier(.., expressionContinuation)
                           listener: handleIdentifier(y, expressionContinuation)
                         listener: handleNoTypeArguments(=)
@@ -474,7 +460,6 @@
                             parsePrimary(=, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                 parseSend(=, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(=)
                                   ensureIdentifier(=, expression)
                                     listener: handleIdentifier(json, expression)
                                   listener: handleNoTypeArguments([)
@@ -505,7 +490,7 @@
                 ensureSemicolon(int)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(Order, null, })
   listener: endTopLevelDeclaration(})
@@ -554,7 +539,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement({)
             parseStatementX({)
               parseReturnStatement({)
@@ -566,7 +551,6 @@
                         parseSendOrFunctionLiteral(return, expression, ConstantPatternContext.none)
                           looksLikeFunctionBody(..)
                           parseSend(return, expression, ConstantPatternContext.none)
-                            isNextIdentifier(return)
                             ensureIdentifier(return, expression)
                               listener: handleIdentifier(Order, expression)
                             listener: handleNoTypeArguments(()
@@ -579,7 +563,6 @@
                     parseCascadeExpression())
                       listener: beginCascade(..)
                       parseSend(.., expressionContinuation, ConstantPatternContext.none)
-                        isNextIdentifier(..)
                         ensureIdentifier(.., expressionContinuation)
                           listener: handleIdentifier(x, expressionContinuation)
                         listener: handleNoTypeArguments(=)
@@ -594,7 +577,6 @@
                             parsePrimary(=, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                 parseSend(=, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(=)
                                   ensureIdentifier(=, expression)
                                     listener: handleIdentifier(json, expression)
                                   listener: handleNoTypeArguments([)
@@ -625,7 +607,7 @@
                 ensureSemicolon(?)
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(Order, null, })
   listener: endTopLevelDeclaration(})
@@ -652,7 +634,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Order, DeclarationKind.Class, Order)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, List)
+            notEofOrType(CLOSE_CURLY_BRACKET, List)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Order)
               parseMetadataStar({)
                 listener: beginMetadataStar(List)
@@ -669,7 +651,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, List, ;)
               listener: endMember()
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Order)
               parseMetadataStar(;)
                 listener: beginMetadataStar(int)
@@ -686,7 +668,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 2, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/issue_47020.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/issue_47020.dart.intertwined.expect
index 08d10ed..049b468 100644
--- a/pkg/front_end/parser_testcases/nnbd/issue_47020.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/issue_47020.dart.intertwined.expect
@@ -25,7 +25,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, Function)
+          notEofOrType(CLOSE_CURLY_BRACKET, Function)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -43,7 +43,7 @@
                                 parseAsyncModifierOpt())
                                   inPlainSync()
                                 parseFunctionBody(), true, false)
-                                  notEofOrValue(}, print)
+                                  notEofOrType(CLOSE_CURLY_BRACKET, print)
                                   parseStatement({)
                                     parseStatementX({)
                                       parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -56,7 +56,6 @@
                                                   parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                                                     looksLikeFunctionBody(})
                                                     parseSend({, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier({)
                                                       ensureIdentifier({, expression)
                                                       parseArgumentsOpt(print)
                                                         parseArguments(print)
@@ -69,7 +68,7 @@
                                           ensureSemicolon())
                                             reportRecoverableError(), Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}])
                                             rewriter()
-                                  notEofOrValue(}, })
+                                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: beginMetadataStar(Function)
                   listener: endMetadataStar(0)
                   listener: handleIdentifier(Function, typeReference)
@@ -101,7 +100,7 @@
                                         inPlainSync()
                                       parseFunctionBody(), true, false)
                                         listener: beginBlockFunctionBody({)
-                                        notEofOrValue(}, print)
+                                        notEofOrType(CLOSE_CURLY_BRACKET, print)
                                         parseStatement({)
                                           parseStatementX({)
                                             parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -114,7 +113,6 @@
                                                         parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                                                           looksLikeFunctionBody(})
                                                           parseSend({, expression, ConstantPatternContext.none)
-                                                            isNextIdentifier({)
                                                             ensureIdentifier({, expression)
                                                               listener: handleIdentifier(print, expression)
                                                             listener: handleNoTypeArguments(()
@@ -135,14 +133,14 @@
                                                     listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], ), ))
                                                   rewriter()
                                                 listener: handleExpressionStatement(print, ;)
-                                        notEofOrValue(}, })
+                                        notEofOrType(CLOSE_CURLY_BRACKET, })
                                         listener: endBlockFunctionBody(1, {, })
                                     listener: endFunctionExpression((, })
                         listener: endVariableInitializer(=)
                       listener: endInitializedIdentifier(f)
                     ensureSemicolon(})
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, f)
+          notEofOrType(CLOSE_CURLY_BRACKET, f)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -155,7 +153,6 @@
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(f, expression)
                               listener: handleNoTypeArguments(()
@@ -167,7 +164,7 @@
                               listener: handleSend(f, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(f, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/issue_48999.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/issue_48999.dart.intertwined.expect
index c700179..3912974 100644
--- a/pkg/front_end/parser_testcases/nnbd/issue_48999.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/issue_48999.dart.intertwined.expect
@@ -25,7 +25,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, dynamic)
+          notEofOrType(CLOSE_CURLY_BRACKET, dynamic)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -54,7 +54,7 @@
                       listener: endInitializedIdentifier(i)
                     ensureSemicolon(10)
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, print)
+          notEofOrType(CLOSE_CURLY_BRACKET, print)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -67,7 +67,6 @@
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(print, expression)
                               listener: handleNoTypeArguments(()
@@ -88,7 +87,6 @@
                                                       parsePrimary(${, expression, ConstantPatternContext.none)
                                                         parseSendOrFunctionLiteral(${, expression, ConstantPatternContext.none)
                                                           parseSend(${, expression, ConstantPatternContext.none)
-                                                            isNextIdentifier(${)
                                                             ensureIdentifier(${, expression)
                                                               listener: handleIdentifier(i, expression)
                                                             listener: handleNoTypeArguments(as)
@@ -112,7 +110,7 @@
                               listener: handleSend(print, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(print, ;)
-          notEofOrValue(}, print)
+          notEofOrType(CLOSE_CURLY_BRACKET, print)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -125,7 +123,6 @@
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(print, expression)
                               listener: handleNoTypeArguments(()
@@ -146,7 +143,6 @@
                                                       parsePrimary(${, expression, ConstantPatternContext.none)
                                                         parseSendOrFunctionLiteral(${, expression, ConstantPatternContext.none)
                                                           parseSend(${, expression, ConstantPatternContext.none)
-                                                            isNextIdentifier(${)
                                                             ensureIdentifier(${, expression)
                                                               listener: handleIdentifier(i, expression)
                                                             listener: handleNoTypeArguments(is)
@@ -170,7 +166,7 @@
                               listener: handleSend(print, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(print, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(3, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/issue_48999_prime.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/issue_48999_prime.dart.intertwined.expect
index 602ffe1..470ec12 100644
--- a/pkg/front_end/parser_testcases/nnbd/issue_48999_prime.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/issue_48999_prime.dart.intertwined.expect
@@ -25,7 +25,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, dynamic)
+          notEofOrType(CLOSE_CURLY_BRACKET, dynamic)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -54,7 +54,7 @@
                       listener: endInitializedIdentifier(i)
                     ensureSemicolon(10)
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, print)
+          notEofOrType(CLOSE_CURLY_BRACKET, print)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -67,7 +67,6 @@
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(print, expression)
                               listener: handleNoTypeArguments(()
@@ -95,7 +94,6 @@
                                                                   parsePrimary((, expression, ConstantPatternContext.none)
                                                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                                       parseSend((, expression, ConstantPatternContext.none)
-                                                                        isNextIdentifier(()
                                                                         ensureIdentifier((, expression)
                                                                           listener: handleIdentifier(i, expression)
                                                                         listener: handleNoTypeArguments(as)
@@ -121,7 +119,7 @@
                               listener: handleSend(print, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(print, ;)
-          notEofOrValue(}, print)
+          notEofOrType(CLOSE_CURLY_BRACKET, print)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -134,7 +132,6 @@
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(print, expression)
                               listener: handleNoTypeArguments(()
@@ -162,7 +159,6 @@
                                                                   parsePrimary((, expression, ConstantPatternContext.none)
                                                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                                       parseSend((, expression, ConstantPatternContext.none)
-                                                                        isNextIdentifier(()
                                                                         ensureIdentifier((, expression)
                                                                           listener: handleIdentifier(i, expression)
                                                                         listener: handleNoTypeArguments(is)
@@ -188,7 +184,7 @@
                               listener: handleSend(print, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(print, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(3, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/issue_49132.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/issue_49132.dart.intertwined.expect
index 5157c7d..11378cb 100644
--- a/pkg/front_end/parser_testcases/nnbd/issue_49132.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/issue_49132.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Foo, DeclarationKind.Class, Foo)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, Foo)
+            notEofOrType(CLOSE_CURLY_BRACKET, Foo)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Foo)
               parseMetadataStar({)
                 listener: beginMetadataStar(Foo)
@@ -85,7 +85,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(=)
@@ -97,7 +96,6 @@
                                 parsePrimary(=, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                     parseSend(=, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(=)
                                       ensureIdentifier(=, expression)
                                         listener: handleIdentifier(a, expression)
                                       listener: handleNoTypeArguments(as)
@@ -124,7 +122,6 @@
                               parsePrimary(,, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                   parseSend(,, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(,)
                                     ensureIdentifier(,, expression)
                                       listener: handleIdentifier(y, expression)
                                     listener: handleNoTypeArguments(=)
@@ -136,7 +133,6 @@
                                 parsePrimary(=, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                     parseSend(=, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(=)
                                       ensureIdentifier(=, expression)
                                         listener: handleIdentifier(b, expression)
                                       listener: handleNoTypeArguments(as)
@@ -163,7 +159,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, Foo, (, :, ;)
               listener: endMember()
-            notEofOrValue(}, Foo)
+            notEofOrType(CLOSE_CURLY_BRACKET, Foo)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(Foo)
@@ -223,7 +219,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(=)
@@ -235,7 +230,6 @@
                                 parsePrimary(=, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                     parseSend(=, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(=)
                                       ensureIdentifier(=, expression)
                                         listener: handleIdentifier(a, expression)
                                       listener: handleNoTypeArguments(is)
@@ -262,7 +256,6 @@
                               parsePrimary(,, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                   parseSend(,, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(,)
                                     ensureIdentifier(,, expression)
                                       listener: handleIdentifier(y, expression)
                                     listener: handleNoTypeArguments(=)
@@ -274,7 +267,6 @@
                                 parsePrimary(=, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                     parseSend(=, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(=)
                                       ensureIdentifier(=, expression)
                                         listener: handleIdentifier(b, expression)
                                       listener: handleNoTypeArguments(is)
@@ -301,7 +293,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, Foo, (, :, ;)
               listener: endMember()
-            notEofOrValue(}, Foo)
+            notEofOrType(CLOSE_CURLY_BRACKET, Foo)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(Foo)
@@ -361,7 +353,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(=)
@@ -373,7 +364,6 @@
                                 parsePrimary(=, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                     parseSend(=, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(=)
                                       ensureIdentifier(=, expression)
                                         listener: handleIdentifier(a, expression)
                                       listener: handleNoTypeArguments(as)
@@ -400,7 +390,6 @@
                               parsePrimary(,, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                   parseSend(,, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(,)
                                     ensureIdentifier(,, expression)
                                       listener: handleIdentifier(y, expression)
                                     listener: handleNoTypeArguments(=)
@@ -412,7 +401,6 @@
                                 parsePrimary(=, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                     parseSend(=, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(=)
                                       ensureIdentifier(=, expression)
                                         listener: handleIdentifier(b, expression)
                                       listener: handleNoTypeArguments(as)
@@ -439,7 +427,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, Foo, (, :, ;)
               listener: endMember()
-            notEofOrValue(}, Foo)
+            notEofOrType(CLOSE_CURLY_BRACKET, Foo)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(Foo)
@@ -499,7 +487,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(=)
@@ -511,7 +498,6 @@
                                 parsePrimary(=, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                     parseSend(=, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(=)
                                       ensureIdentifier(=, expression)
                                         listener: handleIdentifier(a, expression)
                                       listener: handleNoTypeArguments(is)
@@ -538,7 +524,6 @@
                               parsePrimary(,, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                   parseSend(,, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(,)
                                     ensureIdentifier(,, expression)
                                       listener: handleIdentifier(y, expression)
                                     listener: handleNoTypeArguments(=)
@@ -550,7 +535,6 @@
                                 parsePrimary(=, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                     parseSend(=, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(=)
                                       ensureIdentifier(=, expression)
                                         listener: handleIdentifier(b, expression)
                                       listener: handleNoTypeArguments(is)
@@ -577,7 +561,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, Foo, (, :, ;)
               listener: endMember()
-            notEofOrValue(}, Foo)
+            notEofOrType(CLOSE_CURLY_BRACKET, Foo)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(Foo)
@@ -637,7 +621,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(=)
@@ -649,7 +632,6 @@
                                 parsePrimary(=, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                     parseSend(=, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(=)
                                       ensureIdentifier(=, expression)
                                         listener: handleIdentifier(a, expression)
                                       listener: handleNoTypeArguments(as)
@@ -676,7 +658,6 @@
                               parsePrimary(,, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                   parseSend(,, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(,)
                                     ensureIdentifier(,, expression)
                                       listener: handleIdentifier(y, expression)
                                     listener: handleNoTypeArguments(=)
@@ -688,7 +669,6 @@
                                 parsePrimary(=, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                     parseSend(=, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(=)
                                       ensureIdentifier(=, expression)
                                         listener: handleIdentifier(b, expression)
                                       listener: handleNoTypeArguments(as)
@@ -719,11 +699,11 @@
                 inPlainSync()
                 parseFunctionBody(?, false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassConstructor(null, Foo, (, :, })
               listener: endMember()
-            notEofOrValue(}, Foo)
+            notEofOrType(CLOSE_CURLY_BRACKET, Foo)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(Foo)
@@ -783,7 +763,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(=)
@@ -795,7 +774,6 @@
                                 parsePrimary(=, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                     parseSend(=, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(=)
                                       ensureIdentifier(=, expression)
                                         listener: handleIdentifier(a, expression)
                                       listener: handleNoTypeArguments(is)
@@ -822,7 +800,6 @@
                               parsePrimary(,, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                   parseSend(,, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(,)
                                     ensureIdentifier(,, expression)
                                       listener: handleIdentifier(y, expression)
                                     listener: handleNoTypeArguments(=)
@@ -834,7 +811,6 @@
                                 parsePrimary(=, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                     parseSend(=, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(=)
                                       ensureIdentifier(=, expression)
                                         listener: handleIdentifier(b, expression)
                                       listener: handleNoTypeArguments(is)
@@ -865,11 +841,11 @@
                 inPlainSync()
                 parseFunctionBody(?, false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassConstructor(null, Foo, (, :, })
               listener: endMember()
-            notEofOrValue(}, Foo)
+            notEofOrType(CLOSE_CURLY_BRACKET, Foo)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(Foo)
@@ -929,7 +905,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(=)
@@ -941,7 +916,6 @@
                                 parsePrimary(=, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                     parseSend(=, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(=)
                                       ensureIdentifier(=, expression)
                                         listener: handleIdentifier(a, expression)
                                       listener: handleNoTypeArguments(as)
@@ -968,7 +942,6 @@
                               parsePrimary(,, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                   parseSend(,, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(,)
                                     ensureIdentifier(,, expression)
                                       listener: handleIdentifier(y, expression)
                                     listener: handleNoTypeArguments(=)
@@ -980,7 +953,6 @@
                                 parsePrimary(=, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                     parseSend(=, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(=)
                                       ensureIdentifier(=, expression)
                                         listener: handleIdentifier(b, expression)
                                       listener: handleNoTypeArguments(as)
@@ -1005,11 +977,11 @@
                 inPlainSync()
                 parseFunctionBody(int, false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassConstructor(null, Foo, (, :, })
               listener: endMember()
-            notEofOrValue(}, Foo)
+            notEofOrType(CLOSE_CURLY_BRACKET, Foo)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(Foo)
@@ -1069,7 +1041,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(=)
@@ -1081,7 +1052,6 @@
                                 parsePrimary(=, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                     parseSend(=, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(=)
                                       ensureIdentifier(=, expression)
                                         listener: handleIdentifier(a, expression)
                                       listener: handleNoTypeArguments(is)
@@ -1108,7 +1078,6 @@
                               parsePrimary(,, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                   parseSend(,, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(,)
                                     ensureIdentifier(,, expression)
                                       listener: handleIdentifier(y, expression)
                                     listener: handleNoTypeArguments(=)
@@ -1120,7 +1089,6 @@
                                 parsePrimary(=, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                     parseSend(=, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(=)
                                       ensureIdentifier(=, expression)
                                         listener: handleIdentifier(b, expression)
                                       listener: handleNoTypeArguments(is)
@@ -1145,11 +1113,11 @@
                 inPlainSync()
                 parseFunctionBody(int, false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassConstructor(null, Foo, (, :, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 8, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/issue_49132_not_nullable.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/issue_49132_not_nullable.dart.intertwined.expect
index 2f020da..3be5374 100644
--- a/pkg/front_end/parser_testcases/nnbd/issue_49132_not_nullable.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/issue_49132_not_nullable.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Foo, DeclarationKind.Class, Foo)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, dynamic)
+            notEofOrType(CLOSE_CURLY_BRACKET, dynamic)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Foo)
               parseMetadataStar({)
                 listener: beginMetadataStar(dynamic)
@@ -42,7 +42,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, dynamic, ;)
               listener: endMember()
-            notEofOrValue(}, Foo)
+            notEofOrType(CLOSE_CURLY_BRACKET, Foo)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(Foo)
@@ -90,7 +90,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(=)
@@ -102,7 +101,6 @@
                                 parsePrimary(=, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                     parseSend(=, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(=)
                                       ensureIdentifier(=, expression)
                                         listener: handleIdentifier(a, expression)
                                       listener: handleNoTypeArguments(is)
@@ -163,11 +161,11 @@
                 inPlainSync()
                 parseFunctionBody(], false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassConstructor(null, Foo, (, :, })
               listener: endMember()
-            notEofOrValue(}, Foo)
+            notEofOrType(CLOSE_CURLY_BRACKET, Foo)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(Foo)
@@ -215,7 +213,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(=)
@@ -227,7 +224,6 @@
                                 parsePrimary(=, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                     parseSend(=, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(=)
                                       ensureIdentifier(=, expression)
                                         listener: handleIdentifier(a, expression)
                                       listener: handleNoTypeArguments(is)
@@ -339,11 +335,11 @@
                 inPlainSync()
                 parseFunctionBody(], false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassConstructor(null, Foo, (, :, })
               listener: endMember()
-            notEofOrValue(}, Foo)
+            notEofOrType(CLOSE_CURLY_BRACKET, Foo)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(Foo)
@@ -391,7 +387,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(=)
@@ -403,7 +398,6 @@
                                 parsePrimary(=, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                     parseSend(=, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(=)
                                       ensureIdentifier(=, expression)
                                         listener: handleIdentifier(a, expression)
                                       listener: handleNoTypeArguments(as)
@@ -464,11 +458,11 @@
                 inPlainSync()
                 parseFunctionBody(], false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassConstructor(null, Foo, (, :, })
               listener: endMember()
-            notEofOrValue(}, Foo)
+            notEofOrType(CLOSE_CURLY_BRACKET, Foo)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(Foo)
@@ -516,7 +510,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(=)
@@ -528,7 +521,6 @@
                                 parsePrimary(=, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                     parseSend(=, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(=)
                                       ensureIdentifier(=, expression)
                                         listener: handleIdentifier(a, expression)
                                       listener: handleNoTypeArguments(as)
@@ -640,11 +632,11 @@
                 inPlainSync()
                 parseFunctionBody(], false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassConstructor(null, Foo, (, :, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 5, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/issue_49132_prime.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/issue_49132_prime.dart.intertwined.expect
index f1235bf..cdf08c9 100644
--- a/pkg/front_end/parser_testcases/nnbd/issue_49132_prime.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/issue_49132_prime.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Foo, DeclarationKind.Class, Foo)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, Foo)
+            notEofOrType(CLOSE_CURLY_BRACKET, Foo)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Foo)
               parseMetadataStar({)
                 listener: beginMetadataStar(Foo)
@@ -85,7 +85,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(=)
@@ -104,7 +103,6 @@
                                             parsePrimary((, expression, ConstantPatternContext.none)
                                               parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                 parseSend((, expression, ConstantPatternContext.none)
-                                                  isNextIdentifier(()
                                                   ensureIdentifier((, expression)
                                                     listener: handleIdentifier(a, expression)
                                                   listener: handleNoTypeArguments(as)
@@ -133,7 +131,6 @@
                               parsePrimary(,, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                   parseSend(,, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(,)
                                     ensureIdentifier(,, expression)
                                       listener: handleIdentifier(y, expression)
                                     listener: handleNoTypeArguments(=)
@@ -152,7 +149,6 @@
                                             parsePrimary((, expression, ConstantPatternContext.none)
                                               parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                 parseSend((, expression, ConstantPatternContext.none)
-                                                  isNextIdentifier(()
                                                   ensureIdentifier((, expression)
                                                     listener: handleIdentifier(b, expression)
                                                   listener: handleNoTypeArguments(as)
@@ -181,7 +177,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, Foo, (, :, ;)
               listener: endMember()
-            notEofOrValue(}, Foo)
+            notEofOrType(CLOSE_CURLY_BRACKET, Foo)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(Foo)
@@ -241,7 +237,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(=)
@@ -260,7 +255,6 @@
                                             parsePrimary((, expression, ConstantPatternContext.none)
                                               parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                 parseSend((, expression, ConstantPatternContext.none)
-                                                  isNextIdentifier(()
                                                   ensureIdentifier((, expression)
                                                     listener: handleIdentifier(a, expression)
                                                   listener: handleNoTypeArguments(is)
@@ -289,7 +283,6 @@
                               parsePrimary(,, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                   parseSend(,, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(,)
                                     ensureIdentifier(,, expression)
                                       listener: handleIdentifier(y, expression)
                                     listener: handleNoTypeArguments(=)
@@ -308,7 +301,6 @@
                                             parsePrimary((, expression, ConstantPatternContext.none)
                                               parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                 parseSend((, expression, ConstantPatternContext.none)
-                                                  isNextIdentifier(()
                                                   ensureIdentifier((, expression)
                                                     listener: handleIdentifier(b, expression)
                                                   listener: handleNoTypeArguments(is)
@@ -337,7 +329,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, Foo, (, :, ;)
               listener: endMember()
-            notEofOrValue(}, Foo)
+            notEofOrType(CLOSE_CURLY_BRACKET, Foo)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(Foo)
@@ -397,7 +389,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(=)
@@ -416,7 +407,6 @@
                                             parsePrimary((, expression, ConstantPatternContext.none)
                                               parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                 parseSend((, expression, ConstantPatternContext.none)
-                                                  isNextIdentifier(()
                                                   ensureIdentifier((, expression)
                                                     listener: handleIdentifier(a, expression)
                                                   listener: handleNoTypeArguments(as)
@@ -445,7 +435,6 @@
                               parsePrimary(,, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                   parseSend(,, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(,)
                                     ensureIdentifier(,, expression)
                                       listener: handleIdentifier(y, expression)
                                     listener: handleNoTypeArguments(=)
@@ -464,7 +453,6 @@
                                             parsePrimary((, expression, ConstantPatternContext.none)
                                               parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                 parseSend((, expression, ConstantPatternContext.none)
-                                                  isNextIdentifier(()
                                                   ensureIdentifier((, expression)
                                                     listener: handleIdentifier(b, expression)
                                                   listener: handleNoTypeArguments(as)
@@ -493,7 +481,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, Foo, (, :, ;)
               listener: endMember()
-            notEofOrValue(}, Foo)
+            notEofOrType(CLOSE_CURLY_BRACKET, Foo)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(Foo)
@@ -553,7 +541,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(=)
@@ -572,7 +559,6 @@
                                             parsePrimary((, expression, ConstantPatternContext.none)
                                               parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                 parseSend((, expression, ConstantPatternContext.none)
-                                                  isNextIdentifier(()
                                                   ensureIdentifier((, expression)
                                                     listener: handleIdentifier(a, expression)
                                                   listener: handleNoTypeArguments(is)
@@ -601,7 +587,6 @@
                               parsePrimary(,, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                   parseSend(,, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(,)
                                     ensureIdentifier(,, expression)
                                       listener: handleIdentifier(y, expression)
                                     listener: handleNoTypeArguments(=)
@@ -620,7 +605,6 @@
                                             parsePrimary((, expression, ConstantPatternContext.none)
                                               parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                 parseSend((, expression, ConstantPatternContext.none)
-                                                  isNextIdentifier(()
                                                   ensureIdentifier((, expression)
                                                     listener: handleIdentifier(b, expression)
                                                   listener: handleNoTypeArguments(is)
@@ -649,7 +633,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, Foo, (, :, ;)
               listener: endMember()
-            notEofOrValue(}, Foo)
+            notEofOrType(CLOSE_CURLY_BRACKET, Foo)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(Foo)
@@ -709,7 +693,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(=)
@@ -728,7 +711,6 @@
                                             parsePrimary((, expression, ConstantPatternContext.none)
                                               parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                 parseSend((, expression, ConstantPatternContext.none)
-                                                  isNextIdentifier(()
                                                   ensureIdentifier((, expression)
                                                     listener: handleIdentifier(a, expression)
                                                   listener: handleNoTypeArguments(as)
@@ -757,7 +739,6 @@
                               parsePrimary(,, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                   parseSend(,, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(,)
                                     ensureIdentifier(,, expression)
                                       listener: handleIdentifier(y, expression)
                                     listener: handleNoTypeArguments(=)
@@ -776,7 +757,6 @@
                                             parsePrimary((, expression, ConstantPatternContext.none)
                                               parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                 parseSend((, expression, ConstantPatternContext.none)
-                                                  isNextIdentifier(()
                                                   ensureIdentifier((, expression)
                                                     listener: handleIdentifier(b, expression)
                                                   listener: handleNoTypeArguments(as)
@@ -803,11 +783,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassConstructor(null, Foo, (, :, })
               listener: endMember()
-            notEofOrValue(}, Foo)
+            notEofOrType(CLOSE_CURLY_BRACKET, Foo)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(Foo)
@@ -867,7 +847,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(=)
@@ -886,7 +865,6 @@
                                             parsePrimary((, expression, ConstantPatternContext.none)
                                               parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                 parseSend((, expression, ConstantPatternContext.none)
-                                                  isNextIdentifier(()
                                                   ensureIdentifier((, expression)
                                                     listener: handleIdentifier(a, expression)
                                                   listener: handleNoTypeArguments(is)
@@ -915,7 +893,6 @@
                               parsePrimary(,, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                   parseSend(,, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(,)
                                     ensureIdentifier(,, expression)
                                       listener: handleIdentifier(y, expression)
                                     listener: handleNoTypeArguments(=)
@@ -934,7 +911,6 @@
                                             parsePrimary((, expression, ConstantPatternContext.none)
                                               parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                 parseSend((, expression, ConstantPatternContext.none)
-                                                  isNextIdentifier(()
                                                   ensureIdentifier((, expression)
                                                     listener: handleIdentifier(b, expression)
                                                   listener: handleNoTypeArguments(is)
@@ -961,11 +937,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassConstructor(null, Foo, (, :, })
               listener: endMember()
-            notEofOrValue(}, Foo)
+            notEofOrType(CLOSE_CURLY_BRACKET, Foo)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(Foo)
@@ -1025,7 +1001,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(=)
@@ -1044,7 +1019,6 @@
                                             parsePrimary((, expression, ConstantPatternContext.none)
                                               parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                 parseSend((, expression, ConstantPatternContext.none)
-                                                  isNextIdentifier(()
                                                   ensureIdentifier((, expression)
                                                     listener: handleIdentifier(a, expression)
                                                   listener: handleNoTypeArguments(as)
@@ -1073,7 +1047,6 @@
                               parsePrimary(,, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                   parseSend(,, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(,)
                                     ensureIdentifier(,, expression)
                                       listener: handleIdentifier(y, expression)
                                     listener: handleNoTypeArguments(=)
@@ -1092,7 +1065,6 @@
                                             parsePrimary((, expression, ConstantPatternContext.none)
                                               parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                 parseSend((, expression, ConstantPatternContext.none)
-                                                  isNextIdentifier(()
                                                   ensureIdentifier((, expression)
                                                     listener: handleIdentifier(b, expression)
                                                   listener: handleNoTypeArguments(as)
@@ -1119,11 +1091,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassConstructor(null, Foo, (, :, })
               listener: endMember()
-            notEofOrValue(}, Foo)
+            notEofOrType(CLOSE_CURLY_BRACKET, Foo)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(Foo)
@@ -1183,7 +1155,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(=)
@@ -1202,7 +1173,6 @@
                                             parsePrimary((, expression, ConstantPatternContext.none)
                                               parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                 parseSend((, expression, ConstantPatternContext.none)
-                                                  isNextIdentifier(()
                                                   ensureIdentifier((, expression)
                                                     listener: handleIdentifier(a, expression)
                                                   listener: handleNoTypeArguments(is)
@@ -1231,7 +1201,6 @@
                               parsePrimary(,, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                   parseSend(,, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(,)
                                     ensureIdentifier(,, expression)
                                       listener: handleIdentifier(y, expression)
                                     listener: handleNoTypeArguments(=)
@@ -1250,7 +1219,6 @@
                                             parsePrimary((, expression, ConstantPatternContext.none)
                                               parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                 parseSend((, expression, ConstantPatternContext.none)
-                                                  isNextIdentifier(()
                                                   ensureIdentifier((, expression)
                                                     listener: handleIdentifier(b, expression)
                                                   listener: handleNoTypeArguments(is)
@@ -1277,11 +1245,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassConstructor(null, Foo, (, :, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 8, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/issue_49678.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/issue_49678.dart.intertwined.expect
index 3fa6590..c26f0e8 100644
--- a/pkg/front_end/parser_testcases/nnbd/issue_49678.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/issue_49678.dart.intertwined.expect
@@ -39,7 +39,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, Map)
+          notEofOrType(CLOSE_CURLY_BRACKET, Map)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -89,7 +89,7 @@
                     listener: endInitializedIdentifier(m)
                   ensureSemicolon(})
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, m)
+          notEofOrType(CLOSE_CURLY_BRACKET, m)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -101,7 +101,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(m, expression)
                               listener: handleNoTypeArguments([)
@@ -115,7 +114,6 @@
                               parsePrimary([, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                   parseSend([, expression, ConstantPatternContext.none)
-                                    isNextIdentifier([)
                                     ensureIdentifier([, expression)
                                       listener: handleIdentifier(i, expression)
                                     listener: handleNoTypeArguments(as)
@@ -134,7 +132,7 @@
                         listener: handleIndexedExpression(null, [, ])
                   ensureSemicolon(])
                   listener: handleExpressionStatement(m, ;)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(var, ;, null, var, null, null)
@@ -162,7 +160,6 @@
                                       parsePrimary([, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                           parseSend([, expression, ConstantPatternContext.none)
-                                            isNextIdentifier([)
                                             ensureIdentifier([, expression)
                                               listener: handleIdentifier(i, expression)
                                             listener: handleNoTypeArguments(as)
@@ -184,7 +181,6 @@
                                       parsePrimary(,, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                           parseSend(,, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(,)
                                             ensureIdentifier(,, expression)
                                               listener: handleIdentifier(i, expression)
                                             listener: handleNoTypeArguments(as)
@@ -206,7 +202,6 @@
                                       parsePrimary(,, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                           parseSend(,, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(,)
                                             ensureIdentifier(,, expression)
                                               listener: handleIdentifier(i, expression)
                                             listener: handleNoTypeArguments(as)
@@ -227,7 +222,7 @@
                     listener: endInitializedIdentifier(list)
                   ensureSemicolon(])
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(var, ;, null, var, null, null)
@@ -255,7 +250,6 @@
                                       parsePrimary([, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                           parseSend([, expression, ConstantPatternContext.none)
-                                            isNextIdentifier([)
                                             ensureIdentifier([, expression)
                                               listener: handleIdentifier(i, expression)
                                             listener: handleNoTypeArguments(is)
@@ -277,7 +271,6 @@
                                       parsePrimary(,, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                           parseSend(,, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(,)
                                             ensureIdentifier(,, expression)
                                               listener: handleIdentifier(i, expression)
                                             listener: handleNoTypeArguments(is)
@@ -299,7 +292,6 @@
                                       parsePrimary(,, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                           parseSend(,, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(,)
                                             ensureIdentifier(,, expression)
                                               listener: handleIdentifier(i, expression)
                                             listener: handleNoTypeArguments(is)
@@ -320,7 +312,7 @@
                     listener: endInitializedIdentifier(list2)
                   ensureSemicolon(])
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -337,7 +329,6 @@
                                 parsePrimary([, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                     parseSend([, expression, ConstantPatternContext.none)
-                                      isNextIdentifier([)
                                       ensureIdentifier([, expression)
                                         listener: handleIdentifier(list, expression)
                                       listener: handleNoTypeArguments(.)
@@ -347,7 +338,6 @@
                               parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                   parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                    isNextIdentifier(.)
                                     ensureIdentifier(., expressionContinuation)
                                       listener: handleIdentifier(first, expressionContinuation)
                                     listener: handleNoTypeArguments(,)
@@ -361,7 +351,6 @@
                                 parsePrimary(,, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                     parseSend(,, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(,)
                                       ensureIdentifier(,, expression)
                                         listener: handleIdentifier(list2, expression)
                                       listener: handleNoTypeArguments(.)
@@ -371,7 +360,6 @@
                               parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                   parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                    isNextIdentifier(.)
                                     ensureIdentifier(., expressionContinuation)
                                       listener: handleIdentifier(first, expressionContinuation)
                                     listener: handleNoTypeArguments(])
@@ -383,7 +371,7 @@
                 ensureSemicolon(])
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(5, {, })
         listener: endTopLevelMethod(dynamic, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/issue_49678_prime.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/issue_49678_prime.dart.intertwined.expect
index b0e5b4d..8503de5 100644
--- a/pkg/front_end/parser_testcases/nnbd/issue_49678_prime.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/issue_49678_prime.dart.intertwined.expect
@@ -39,7 +39,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, Map)
+          notEofOrType(CLOSE_CURLY_BRACKET, Map)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -89,7 +89,7 @@
                     listener: endInitializedIdentifier(m)
                   ensureSemicolon(})
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, m)
+          notEofOrType(CLOSE_CURLY_BRACKET, m)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -101,7 +101,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(m, expression)
                               listener: handleNoTypeArguments([)
@@ -122,7 +121,6 @@
                                           parsePrimary((, expression, ConstantPatternContext.none)
                                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                               parseSend((, expression, ConstantPatternContext.none)
-                                                isNextIdentifier(()
                                                 ensureIdentifier((, expression)
                                                   listener: handleIdentifier(i, expression)
                                                 listener: handleNoTypeArguments(as)
@@ -143,7 +141,7 @@
                         listener: handleIndexedExpression(null, [, ])
                   ensureSemicolon(])
                   listener: handleExpressionStatement(m, ;)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(var, ;, null, var, null, null)
@@ -178,7 +176,6 @@
                                                   parsePrimary((, expression, ConstantPatternContext.none)
                                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                       parseSend((, expression, ConstantPatternContext.none)
-                                                        isNextIdentifier(()
                                                         ensureIdentifier((, expression)
                                                           listener: handleIdentifier(i, expression)
                                                         listener: handleNoTypeArguments(as)
@@ -209,7 +206,6 @@
                                                   parsePrimary((, expression, ConstantPatternContext.none)
                                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                       parseSend((, expression, ConstantPatternContext.none)
-                                                        isNextIdentifier(()
                                                         ensureIdentifier((, expression)
                                                           listener: handleIdentifier(i, expression)
                                                         listener: handleNoTypeArguments(as)
@@ -240,7 +236,6 @@
                                                   parsePrimary((, expression, ConstantPatternContext.none)
                                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                       parseSend((, expression, ConstantPatternContext.none)
-                                                        isNextIdentifier(()
                                                         ensureIdentifier((, expression)
                                                           listener: handleIdentifier(i, expression)
                                                         listener: handleNoTypeArguments(as)
@@ -263,7 +258,7 @@
                     listener: endInitializedIdentifier(list)
                   ensureSemicolon(])
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(var, ;, null, var, null, null)
@@ -298,7 +293,6 @@
                                                   parsePrimary((, expression, ConstantPatternContext.none)
                                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                       parseSend((, expression, ConstantPatternContext.none)
-                                                        isNextIdentifier(()
                                                         ensureIdentifier((, expression)
                                                           listener: handleIdentifier(i, expression)
                                                         listener: handleNoTypeArguments(is)
@@ -329,7 +323,6 @@
                                                   parsePrimary((, expression, ConstantPatternContext.none)
                                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                       parseSend((, expression, ConstantPatternContext.none)
-                                                        isNextIdentifier(()
                                                         ensureIdentifier((, expression)
                                                           listener: handleIdentifier(i, expression)
                                                         listener: handleNoTypeArguments(is)
@@ -360,7 +353,6 @@
                                                   parsePrimary((, expression, ConstantPatternContext.none)
                                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                       parseSend((, expression, ConstantPatternContext.none)
-                                                        isNextIdentifier(()
                                                         ensureIdentifier((, expression)
                                                           listener: handleIdentifier(i, expression)
                                                         listener: handleNoTypeArguments(is)
@@ -383,7 +375,7 @@
                     listener: endInitializedIdentifier(list2)
                   ensureSemicolon(])
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -400,7 +392,6 @@
                                 parsePrimary([, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                     parseSend([, expression, ConstantPatternContext.none)
-                                      isNextIdentifier([)
                                       ensureIdentifier([, expression)
                                         listener: handleIdentifier(list, expression)
                                       listener: handleNoTypeArguments(.)
@@ -410,7 +401,6 @@
                               parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                   parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                    isNextIdentifier(.)
                                     ensureIdentifier(., expressionContinuation)
                                       listener: handleIdentifier(first, expressionContinuation)
                                     listener: handleNoTypeArguments(,)
@@ -424,7 +414,6 @@
                                 parsePrimary(,, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                     parseSend(,, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(,)
                                       ensureIdentifier(,, expression)
                                         listener: handleIdentifier(list2, expression)
                                       listener: handleNoTypeArguments(.)
@@ -434,7 +423,6 @@
                               parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                   parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                    isNextIdentifier(.)
                                     ensureIdentifier(., expressionContinuation)
                                       listener: handleIdentifier(first, expressionContinuation)
                                     listener: handleNoTypeArguments(])
@@ -446,7 +434,7 @@
                 ensureSemicolon(])
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(5, {, })
         listener: endTopLevelMethod(dynamic, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/late_member.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/late_member.dart.intertwined.expect
index 50beda2..d15f404 100644
--- a/pkg/front_end/parser_testcases/nnbd/late_member.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/late_member.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, dynamic)
+          notEofOrType(CLOSE_CURLY_BRACKET, dynamic)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -50,7 +50,6 @@
                             parseUnaryExpression(=, true, ConstantPatternContext.none)
                               parsePrimary(=, expression, ConstantPatternContext.none)
                                 parseNewExpression(=)
-                                  isNextIdentifier(new)
                                   listener: beginNewExpression(new)
                                   parseConstructorReference(new, ConstructorReferenceContext.New, null)
                                     ensureIdentifier(new, constructorReference)
@@ -69,7 +68,7 @@
                       listener: endInitializedIdentifier(foo)
                     ensureSemicolon())
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(var, ;, null, var, null, null)
@@ -91,7 +90,6 @@
                             parsePrimary(=, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                 parseSend(=, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(=)
                                   ensureIdentifier(=, expression)
                                     listener: handleIdentifier(foo, expression)
                                   listener: handleNoTypeArguments(.)
@@ -102,7 +100,6 @@
                             inPlainSync()
                             parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                               parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                isNextIdentifier(.)
                                 ensureIdentifier(., expressionContinuation)
                                   inPlainSync()
                                   listener: handleIdentifier(late, expressionContinuation)
@@ -115,7 +112,7 @@
                     listener: endInitializedIdentifier(bar)
                   ensureSemicolon(late)
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, late)
+          notEofOrType(CLOSE_CURLY_BRACKET, late)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -130,7 +127,6 @@
                             parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                               looksLikeFunctionBody(;)
                               parseSend(;, expression, ConstantPatternContext.none)
-                                isNextIdentifier(;)
                                 ensureIdentifier(;, expression)
                                   inPlainSync()
                                   listener: handleIdentifier(late, expression)
@@ -143,7 +139,7 @@
                                 listener: handleSend(late, ))
                     ensureSemicolon())
                     listener: handleExpressionStatement(late, ;)
-          notEofOrValue(}, bar)
+          notEofOrType(CLOSE_CURLY_BRACKET, bar)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -156,7 +152,6 @@
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(bar, expression)
                               listener: handleNoTypeArguments(()
@@ -168,7 +163,7 @@
                               listener: handleSend(bar, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(bar, ;)
-          notEofOrValue(}, new)
+          notEofOrType(CLOSE_CURLY_BRACKET, new)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -180,7 +175,6 @@
                         parseUnaryExpression(;, true, ConstantPatternContext.none)
                           parsePrimary(;, expression, ConstantPatternContext.none)
                             parseNewExpression(;)
-                              isNextIdentifier(new)
                               listener: beginNewExpression(new)
                               parseConstructorReference(new, ConstructorReferenceContext.New, null)
                                 ensureIdentifier(new, constructorReference)
@@ -199,7 +193,6 @@
                           inPlainSync()
                           parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                             parseSend(., expressionContinuation, ConstantPatternContext.none)
-                              isNextIdentifier(.)
                               ensureIdentifier(., expressionContinuation)
                                 inPlainSync()
                                 listener: handleIdentifier(late, expressionContinuation)
@@ -213,7 +206,7 @@
                         listener: handleEndingBinaryExpression(., ))
                     ensureSemicolon())
                     listener: handleExpressionStatement(new, ;)
-          notEofOrValue(}, new)
+          notEofOrType(CLOSE_CURLY_BRACKET, new)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -225,7 +218,6 @@
                         parseUnaryExpression(;, true, ConstantPatternContext.none)
                           parsePrimary(;, expression, ConstantPatternContext.none)
                             parseNewExpression(;)
-                              isNextIdentifier(new)
                               listener: beginNewExpression(new)
                               parseConstructorReference(new, ConstructorReferenceContext.New, null)
                                 ensureIdentifier(new, constructorReference)
@@ -244,7 +236,6 @@
                           inPlainSync()
                           parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                             parseSend(., expressionContinuation, ConstantPatternContext.none)
-                              isNextIdentifier(.)
                               ensureIdentifier(., expressionContinuation)
                                 inPlainSync()
                                 listener: handleIdentifier(late, expressionContinuation)
@@ -255,7 +246,7 @@
                         listener: handleEndingBinaryExpression(., late)
                     ensureSemicolon(late)
                     listener: handleExpressionStatement(new, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(6, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
@@ -283,7 +274,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, print)
+          notEofOrType(CLOSE_CURLY_BRACKET, print)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -296,7 +287,6 @@
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(print, expression)
                               listener: handleNoTypeArguments(()
@@ -316,7 +306,7 @@
                               listener: handleSend(print, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(print, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(late, null, })
   listener: endTopLevelDeclaration(})
@@ -343,7 +333,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(X, DeclarationKind.Class, X)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, late)
+            notEofOrType(CLOSE_CURLY_BRACKET, late)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, X)
               parseMetadataStar({)
                 listener: beginMetadataStar(late)
@@ -370,7 +360,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, print)
+                  notEofOrType(CLOSE_CURLY_BRACKET, print)
                   parseStatement({)
                     parseStatementX({)
                       parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -383,7 +373,6 @@
                                   parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                                     looksLikeFunctionBody(;)
                                     parseSend({, expression, ConstantPatternContext.none)
-                                      isNextIdentifier({)
                                       ensureIdentifier({, expression)
                                         listener: handleIdentifier(print, expression)
                                       listener: handleNoTypeArguments(()
@@ -403,11 +392,11 @@
                                       listener: handleSend(print, ))
                           ensureSemicolon())
                           listener: handleExpressionStatement(print, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(null, late, (, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -434,7 +423,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Y, DeclarationKind.Class, Y)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Y)
               parseMetadataStar({)
                 listener: beginMetadataStar(int)
@@ -458,7 +447,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/late_modifier.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/late_modifier.dart.intertwined.expect
index 07aca36..e639bbe 100644
--- a/pkg/front_end/parser_testcases/nnbd/late_modifier.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/late_modifier.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, dynamic)
+          notEofOrType(CLOSE_CURLY_BRACKET, dynamic)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -50,7 +50,6 @@
                             parseUnaryExpression(=, true, ConstantPatternContext.none)
                               parsePrimary(=, expression, ConstantPatternContext.none)
                                 parseNewExpression(=)
-                                  isNextIdentifier(new)
                                   listener: beginNewExpression(new)
                                   parseConstructorReference(new, ConstructorReferenceContext.New, null)
                                     ensureIdentifier(new, constructorReference)
@@ -69,7 +68,7 @@
                       listener: endInitializedIdentifier(foo)
                     ensureSemicolon())
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(var, ;, null, var, null, null)
@@ -91,7 +90,6 @@
                             parsePrimary(=, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                 parseSend(=, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(=)
                                   ensureIdentifier(=, expression)
                                     listener: handleIdentifier(foo, expression)
                                   listener: handleNoTypeArguments(.)
@@ -102,7 +100,6 @@
                             inPlainSync()
                             parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                               parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                isNextIdentifier(.)
                                 ensureIdentifier(., expressionContinuation)
                                   inPlainSync()
                                   listener: handleIdentifier(late, expressionContinuation)
@@ -115,7 +112,7 @@
                     listener: endInitializedIdentifier(bar)
                   ensureSemicolon(late)
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, late)
+          notEofOrType(CLOSE_CURLY_BRACKET, late)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -130,7 +127,6 @@
                             parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                               looksLikeFunctionBody(;)
                               parseSend(;, expression, ConstantPatternContext.none)
-                                isNextIdentifier(;)
                                 ensureIdentifier(;, expression)
                                   inPlainSync()
                                   listener: handleIdentifier(late, expression)
@@ -143,7 +139,7 @@
                                 listener: handleSend(late, ))
                     ensureSemicolon())
                     listener: handleExpressionStatement(late, ;)
-          notEofOrValue(}, bar)
+          notEofOrType(CLOSE_CURLY_BRACKET, bar)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -156,7 +152,6 @@
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(bar, expression)
                               listener: handleNoTypeArguments(()
@@ -168,7 +163,7 @@
                               listener: handleSend(bar, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(bar, ;)
-          notEofOrValue(}, new)
+          notEofOrType(CLOSE_CURLY_BRACKET, new)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -180,7 +175,6 @@
                         parseUnaryExpression(;, true, ConstantPatternContext.none)
                           parsePrimary(;, expression, ConstantPatternContext.none)
                             parseNewExpression(;)
-                              isNextIdentifier(new)
                               listener: beginNewExpression(new)
                               parseConstructorReference(new, ConstructorReferenceContext.New, null)
                                 ensureIdentifier(new, constructorReference)
@@ -199,7 +193,6 @@
                           inPlainSync()
                           parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                             parseSend(., expressionContinuation, ConstantPatternContext.none)
-                              isNextIdentifier(.)
                               ensureIdentifier(., expressionContinuation)
                                 inPlainSync()
                                 listener: handleIdentifier(late, expressionContinuation)
@@ -213,7 +206,7 @@
                         listener: handleEndingBinaryExpression(., ))
                     ensureSemicolon())
                     listener: handleExpressionStatement(new, ;)
-          notEofOrValue(}, new)
+          notEofOrType(CLOSE_CURLY_BRACKET, new)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -225,7 +218,6 @@
                         parseUnaryExpression(;, true, ConstantPatternContext.none)
                           parsePrimary(;, expression, ConstantPatternContext.none)
                             parseNewExpression(;)
-                              isNextIdentifier(new)
                               listener: beginNewExpression(new)
                               parseConstructorReference(new, ConstructorReferenceContext.New, null)
                                 ensureIdentifier(new, constructorReference)
@@ -244,7 +236,6 @@
                           inPlainSync()
                           parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                             parseSend(., expressionContinuation, ConstantPatternContext.none)
-                              isNextIdentifier(.)
                               ensureIdentifier(., expressionContinuation)
                                 inPlainSync()
                                 listener: handleIdentifier(late, expressionContinuation)
@@ -255,7 +246,7 @@
                         listener: handleEndingBinaryExpression(., late)
                     ensureSemicolon(late)
                     listener: handleExpressionStatement(new, ;)
-          notEofOrValue(}, late)
+          notEofOrType(CLOSE_CURLY_BRACKET, late)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -277,7 +268,7 @@
                       listener: endInitializedIdentifier(foo)
                     ensureSemicolon(foo)
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, foo)
+          notEofOrType(CLOSE_CURLY_BRACKET, foo)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -289,7 +280,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(foo, expression)
                               listener: handleNoTypeArguments(=)
@@ -304,7 +294,7 @@
                       listener: handleAssignmentExpression(=, 42)
                   ensureSemicolon(42)
                   listener: handleExpressionStatement(foo, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(8, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
@@ -332,7 +322,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, print)
+          notEofOrType(CLOSE_CURLY_BRACKET, print)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -345,7 +335,6 @@
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(print, expression)
                               listener: handleNoTypeArguments(()
@@ -365,7 +354,7 @@
                               listener: handleSend(print, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(print, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(late, null, })
   listener: endTopLevelDeclaration(})
@@ -392,7 +381,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(X, DeclarationKind.Class, X)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, late)
+            notEofOrType(CLOSE_CURLY_BRACKET, late)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, X)
               parseMetadataStar({)
                 listener: beginMetadataStar(late)
@@ -419,7 +408,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, print)
+                  notEofOrType(CLOSE_CURLY_BRACKET, print)
                   parseStatement({)
                     parseStatementX({)
                       parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -432,7 +421,6 @@
                                   parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                                     looksLikeFunctionBody(;)
                                     parseSend({, expression, ConstantPatternContext.none)
-                                      isNextIdentifier({)
                                       ensureIdentifier({, expression)
                                         listener: handleIdentifier(print, expression)
                                       listener: handleNoTypeArguments(()
@@ -452,11 +440,11 @@
                                       listener: handleSend(print, ))
                           ensureSemicolon())
                           listener: handleExpressionStatement(print, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(null, late, (, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -483,7 +471,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Y, DeclarationKind.Class, Y)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Y)
               parseMetadataStar({)
                 listener: beginMetadataStar(int)
@@ -507,7 +495,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/nullCheckBeforeIndex.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/nullCheckBeforeIndex.dart.intertwined.expect
index be9fbd1..6cfdcad 100644
--- a/pkg/front_end/parser_testcases/nnbd/nullCheckBeforeIndex.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/nullCheckBeforeIndex.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, foo)
+          notEofOrType(CLOSE_CURLY_BRACKET, foo)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -38,7 +38,6 @@
                         parsePrimary({, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(foo, expression)
                               listener: handleNoTypeArguments(.)
@@ -48,7 +47,6 @@
                       parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                         parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                           parseSend(., expressionContinuation, ConstantPatternContext.none)
-                            isNextIdentifier(.)
                             ensureIdentifier(., expressionContinuation)
                               listener: handleIdentifier(bar, expressionContinuation)
                             listener: handleNoTypeArguments(!)
@@ -60,7 +58,6 @@
                       parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                         parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                           parseSend(., expressionContinuation, ConstantPatternContext.none)
-                            isNextIdentifier(.)
                             ensureIdentifier(., expressionContinuation)
                               listener: handleIdentifier(baz, expressionContinuation)
                             listener: handleNoTypeArguments([)
@@ -75,7 +72,6 @@
                               parsePrimary([, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                   parseSend([, expression, ConstantPatternContext.none)
-                                    isNextIdentifier([)
                                     ensureIdentifier([, expression)
                                       listener: handleIdentifier(arg, expression)
                                     listener: handleNoTypeArguments(])
@@ -85,7 +81,7 @@
                         listener: handleIndexedExpression(null, [, ])
                   ensureSemicolon(])
                   listener: handleExpressionStatement(foo, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(f, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/nullCheckBeforeIndex_with_parens.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/nullCheckBeforeIndex_with_parens.dart.intertwined.expect
index df074c4..6d272bb 100644
--- a/pkg/front_end/parser_testcases/nnbd/nullCheckBeforeIndex_with_parens.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/nullCheckBeforeIndex_with_parens.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -46,7 +46,6 @@
                                       parsePrimary((, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                           parseSend((, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(()
                                             ensureIdentifier((, expression)
                                               listener: handleIdentifier(foo, expression)
                                             listener: handleNoTypeArguments(.)
@@ -56,7 +55,6 @@
                                     parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                         parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                          isNextIdentifier(.)
                                           ensureIdentifier(., expressionContinuation)
                                             listener: handleIdentifier(bar, expressionContinuation)
                                           listener: handleNoTypeArguments())
@@ -70,7 +68,6 @@
                         parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                             parseSend(., expressionContinuation, ConstantPatternContext.none)
-                              isNextIdentifier(.)
                               ensureIdentifier(., expressionContinuation)
                                 listener: handleIdentifier(baz, expressionContinuation)
                               listener: handleNoTypeArguments([)
@@ -85,7 +82,6 @@
                                 parsePrimary([, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                     parseSend([, expression, ConstantPatternContext.none)
-                                      isNextIdentifier([)
                                       ensureIdentifier([, expression)
                                         listener: handleIdentifier(arg, expression)
                                       listener: handleNoTypeArguments(])
@@ -95,7 +91,7 @@
                           listener: handleIndexedExpression(null, [, ])
                     ensureSemicolon(])
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(f, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/nullCheckOnIndex.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/nullCheckOnIndex.dart.intertwined.expect
index 5b9482d..78c5a8f 100644
--- a/pkg/front_end/parser_testcases/nnbd/nullCheckOnIndex.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/nullCheckOnIndex.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, obj)
+          notEofOrType(CLOSE_CURLY_BRACKET, obj)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -38,7 +38,6 @@
                         parsePrimary({, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(obj, expression)
                               listener: handleNoTypeArguments(!)
@@ -53,7 +52,6 @@
                               parsePrimary([, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                   parseSend([, expression, ConstantPatternContext.none)
-                                    isNextIdentifier([)
                                     ensureIdentifier([, expression)
                                       listener: handleIdentifier(arg, expression)
                                     listener: handleNoTypeArguments(])
@@ -63,7 +61,7 @@
                         listener: handleIndexedExpression(null, [, ])
                   ensureSemicolon(])
                   listener: handleExpressionStatement(obj, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(f, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/nullCheckOnIndex2.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/nullCheckOnIndex2.dart.intertwined.expect
index 6491c28..aba6605 100644
--- a/pkg/front_end/parser_testcases/nnbd/nullCheckOnIndex2.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/nullCheckOnIndex2.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, obj)
+          notEofOrType(CLOSE_CURLY_BRACKET, obj)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -38,7 +38,6 @@
                         parsePrimary({, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(obj, expression)
                               listener: handleNoTypeArguments(!)
@@ -53,7 +52,6 @@
                               parsePrimary([, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                   parseSend([, expression, ConstantPatternContext.none)
-                                    isNextIdentifier([)
                                     ensureIdentifier([, expression)
                                       listener: handleIdentifier(arg, expression)
                                     listener: handleNoTypeArguments(])
@@ -69,7 +67,6 @@
                               parsePrimary([, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                   parseSend([, expression, ConstantPatternContext.none)
-                                    isNextIdentifier([)
                                     ensureIdentifier([, expression)
                                       listener: handleIdentifier(arg2, expression)
                                     listener: handleNoTypeArguments(])
@@ -79,7 +76,7 @@
                         listener: handleIndexedExpression(null, [, ])
                   ensureSemicolon(])
                   listener: handleExpressionStatement(obj, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(f, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/nullCheckOnIndex2_with_parens.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/nullCheckOnIndex2_with_parens.dart.intertwined.expect
index af961dd..c51ec91 100644
--- a/pkg/front_end/parser_testcases/nnbd/nullCheckOnIndex2_with_parens.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/nullCheckOnIndex2_with_parens.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -60,7 +60,6 @@
                                                               parsePrimary((, expression, ConstantPatternContext.none)
                                                                 parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                                   parseSend((, expression, ConstantPatternContext.none)
-                                                                    isNextIdentifier(()
                                                                     ensureIdentifier((, expression)
                                                                       listener: handleIdentifier(obj, expression)
                                                                     listener: handleNoTypeArguments(!)
@@ -77,7 +76,6 @@
                                                         parsePrimary([, expression, ConstantPatternContext.none)
                                                           parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                                             parseSend([, expression, ConstantPatternContext.none)
-                                                              isNextIdentifier([)
                                                               ensureIdentifier([, expression)
                                                                 listener: handleIdentifier(arg, expression)
                                                               listener: handleNoTypeArguments(])
@@ -97,7 +95,6 @@
                                 parsePrimary([, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                     parseSend([, expression, ConstantPatternContext.none)
-                                      isNextIdentifier([)
                                       ensureIdentifier([, expression)
                                         listener: handleIdentifier(arg2, expression)
                                       listener: handleNoTypeArguments(])
@@ -107,7 +104,7 @@
                           listener: handleIndexedExpression(null, [, ])
                     ensureSemicolon(])
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(f, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/nullCheckOnIndex3.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/nullCheckOnIndex3.dart.intertwined.expect
index 2ff98dd..6b51dc1 100644
--- a/pkg/front_end/parser_testcases/nnbd/nullCheckOnIndex3.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/nullCheckOnIndex3.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, foo)
+          notEofOrType(CLOSE_CURLY_BRACKET, foo)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -38,7 +38,6 @@
                         parsePrimary({, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(foo, expression)
                               listener: handleNoTypeArguments(.)
@@ -48,7 +47,6 @@
                       parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                         parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                           parseSend(., expressionContinuation, ConstantPatternContext.none)
-                            isNextIdentifier(.)
                             ensureIdentifier(., expressionContinuation)
                               listener: handleIdentifier(bar, expressionContinuation)
                             listener: handleNoTypeArguments(!)
@@ -64,7 +62,6 @@
                               parsePrimary([, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                   parseSend([, expression, ConstantPatternContext.none)
-                                    isNextIdentifier([)
                                     ensureIdentifier([, expression)
                                       listener: handleIdentifier(arg, expression)
                                     listener: handleNoTypeArguments(])
@@ -74,7 +71,7 @@
                         listener: handleIndexedExpression(null, [, ])
                   ensureSemicolon(])
                   listener: handleExpressionStatement(foo, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(f, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/nullCheckOnIndex3_with_parens.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/nullCheckOnIndex3_with_parens.dart.intertwined.expect
index 959a7ae..2fde544 100644
--- a/pkg/front_end/parser_testcases/nnbd/nullCheckOnIndex3_with_parens.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/nullCheckOnIndex3_with_parens.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -46,7 +46,6 @@
                                       parsePrimary((, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                           parseSend((, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(()
                                             ensureIdentifier((, expression)
                                               listener: handleIdentifier(foo, expression)
                                             listener: handleNoTypeArguments(.)
@@ -56,7 +55,6 @@
                                     parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                         parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                          isNextIdentifier(.)
                                           ensureIdentifier(., expressionContinuation)
                                             listener: handleIdentifier(bar, expressionContinuation)
                                           listener: handleNoTypeArguments())
@@ -74,7 +72,6 @@
                                 parsePrimary([, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                     parseSend([, expression, ConstantPatternContext.none)
-                                      isNextIdentifier([)
                                       ensureIdentifier([, expression)
                                         listener: handleIdentifier(arg, expression)
                                       listener: handleNoTypeArguments(])
@@ -84,7 +81,7 @@
                           listener: handleIndexedExpression(null, [, ])
                     ensureSemicolon(])
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(f, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/nullCheckOnIndex4.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/nullCheckOnIndex4.dart.intertwined.expect
index 2781541..d6836df 100644
--- a/pkg/front_end/parser_testcases/nnbd/nullCheckOnIndex4.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/nullCheckOnIndex4.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, foo)
+          notEofOrType(CLOSE_CURLY_BRACKET, foo)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -38,7 +38,6 @@
                         parsePrimary({, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(foo, expression)
                               listener: handleNoTypeArguments(!)
@@ -49,7 +48,6 @@
                       parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                         parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                           parseSend(., expressionContinuation, ConstantPatternContext.none)
-                            isNextIdentifier(.)
                             ensureIdentifier(., expressionContinuation)
                               listener: handleIdentifier(bar, expressionContinuation)
                             listener: handleNoTypeArguments(!)
@@ -65,7 +63,6 @@
                               parsePrimary([, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                   parseSend([, expression, ConstantPatternContext.none)
-                                    isNextIdentifier([)
                                     ensureIdentifier([, expression)
                                       listener: handleIdentifier(arg, expression)
                                     listener: handleNoTypeArguments(])
@@ -75,7 +72,7 @@
                         listener: handleIndexedExpression(null, [, ])
                   ensureSemicolon(])
                   listener: handleExpressionStatement(foo, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(f, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/nullCheckOnIndex4_with_parens.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/nullCheckOnIndex4_with_parens.dart.intertwined.expect
index 227316f..fb75afd 100644
--- a/pkg/front_end/parser_testcases/nnbd/nullCheckOnIndex4_with_parens.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/nullCheckOnIndex4_with_parens.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -53,7 +53,6 @@
                                                   parsePrimary((, expression, ConstantPatternContext.none)
                                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                       parseSend((, expression, ConstantPatternContext.none)
-                                                        isNextIdentifier(()
                                                         ensureIdentifier((, expression)
                                                           listener: handleIdentifier(foo, expression)
                                                         listener: handleNoTypeArguments(!)
@@ -66,7 +65,6 @@
                                     parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                         parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                          isNextIdentifier(.)
                                           ensureIdentifier(., expressionContinuation)
                                             listener: handleIdentifier(bar, expressionContinuation)
                                           listener: handleNoTypeArguments(!)
@@ -84,7 +82,6 @@
                                 parsePrimary([, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                     parseSend([, expression, ConstantPatternContext.none)
-                                      isNextIdentifier([)
                                       ensureIdentifier([, expression)
                                         listener: handleIdentifier(arg, expression)
                                       listener: handleNoTypeArguments(])
@@ -94,7 +91,7 @@
                           listener: handleIndexedExpression(null, [, ])
                     ensureSemicolon(])
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(f, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/nullCheckOnIndex5.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/nullCheckOnIndex5.dart.intertwined.expect
index 5c76111..3da4d0d 100644
--- a/pkg/front_end/parser_testcases/nnbd/nullCheckOnIndex5.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/nullCheckOnIndex5.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, foo)
+          notEofOrType(CLOSE_CURLY_BRACKET, foo)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -38,7 +38,6 @@
                         parsePrimary({, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(foo, expression)
                               listener: handleNoTypeArguments(.)
@@ -48,7 +47,6 @@
                       parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                         parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                           parseSend(., expressionContinuation, ConstantPatternContext.none)
-                            isNextIdentifier(.)
                             ensureIdentifier(., expressionContinuation)
                               listener: handleIdentifier(bar, expressionContinuation)
                             listener: handleNoTypeArguments(!)
@@ -64,7 +62,6 @@
                               parsePrimary([, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                   parseSend([, expression, ConstantPatternContext.none)
-                                    isNextIdentifier([)
                                     ensureIdentifier([, expression)
                                       listener: handleIdentifier(arg, expression)
                                     listener: handleNoTypeArguments(])
@@ -80,7 +77,6 @@
                               parsePrimary([, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                   parseSend([, expression, ConstantPatternContext.none)
-                                    isNextIdentifier([)
                                     ensureIdentifier([, expression)
                                       listener: handleIdentifier(arg2, expression)
                                     listener: handleNoTypeArguments(])
@@ -90,7 +86,7 @@
                         listener: handleIndexedExpression(null, [, ])
                   ensureSemicolon(])
                   listener: handleExpressionStatement(foo, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(f, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/nullCheckOnIndex5_with_parens.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/nullCheckOnIndex5_with_parens.dart.intertwined.expect
index 415ec64..64f685e 100644
--- a/pkg/front_end/parser_testcases/nnbd/nullCheckOnIndex5_with_parens.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/nullCheckOnIndex5_with_parens.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -60,7 +60,6 @@
                                                               parsePrimary((, expression, ConstantPatternContext.none)
                                                                 parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                                   parseSend((, expression, ConstantPatternContext.none)
-                                                                    isNextIdentifier(()
                                                                     ensureIdentifier((, expression)
                                                                       listener: handleIdentifier(foo, expression)
                                                                     listener: handleNoTypeArguments(.)
@@ -70,7 +69,6 @@
                                                             parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                                                               parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                                                 parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                                                  isNextIdentifier(.)
                                                                   ensureIdentifier(., expressionContinuation)
                                                                     listener: handleIdentifier(bar, expressionContinuation)
                                                                   listener: handleNoTypeArguments(!)
@@ -88,7 +86,6 @@
                                                         parsePrimary([, expression, ConstantPatternContext.none)
                                                           parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                                             parseSend([, expression, ConstantPatternContext.none)
-                                                              isNextIdentifier([)
                                                               ensureIdentifier([, expression)
                                                                 listener: handleIdentifier(arg, expression)
                                                               listener: handleNoTypeArguments(])
@@ -108,7 +105,6 @@
                                 parsePrimary([, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                     parseSend([, expression, ConstantPatternContext.none)
-                                      isNextIdentifier([)
                                       ensureIdentifier([, expression)
                                         listener: handleIdentifier(arg2, expression)
                                       listener: handleNoTypeArguments(])
@@ -118,7 +114,7 @@
                           listener: handleIndexedExpression(null, [, ])
                     ensureSemicolon(])
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(f, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/nullCheckOnIndex6.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/nullCheckOnIndex6.dart.intertwined.expect
index 59af6ce..3e6d88b 100644
--- a/pkg/front_end/parser_testcases/nnbd/nullCheckOnIndex6.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/nullCheckOnIndex6.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, foo)
+          notEofOrType(CLOSE_CURLY_BRACKET, foo)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -38,7 +38,6 @@
                         parsePrimary({, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(foo, expression)
                               listener: handleNoTypeArguments(!)
@@ -49,7 +48,6 @@
                       parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                         parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                           parseSend(., expressionContinuation, ConstantPatternContext.none)
-                            isNextIdentifier(.)
                             ensureIdentifier(., expressionContinuation)
                               listener: handleIdentifier(bar, expressionContinuation)
                             listener: handleNoTypeArguments(!)
@@ -65,7 +63,6 @@
                               parsePrimary([, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                   parseSend([, expression, ConstantPatternContext.none)
-                                    isNextIdentifier([)
                                     ensureIdentifier([, expression)
                                       listener: handleIdentifier(arg, expression)
                                     listener: handleNoTypeArguments(])
@@ -81,7 +78,6 @@
                               parsePrimary([, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                   parseSend([, expression, ConstantPatternContext.none)
-                                    isNextIdentifier([)
                                     ensureIdentifier([, expression)
                                       listener: handleIdentifier(arg2, expression)
                                     listener: handleNoTypeArguments(])
@@ -91,7 +87,7 @@
                         listener: handleIndexedExpression(null, [, ])
                   ensureSemicolon(])
                   listener: handleExpressionStatement(foo, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(f, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/nullCheckOnIndex6_with_parens.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/nullCheckOnIndex6_with_parens.dart.intertwined.expect
index 75c0d4b..51a650a 100644
--- a/pkg/front_end/parser_testcases/nnbd/nullCheckOnIndex6_with_parens.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/nullCheckOnIndex6_with_parens.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -67,7 +67,6 @@
                                                                           parsePrimary((, expression, ConstantPatternContext.none)
                                                                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                                               parseSend((, expression, ConstantPatternContext.none)
-                                                                                isNextIdentifier(()
                                                                                 ensureIdentifier((, expression)
                                                                                   listener: handleIdentifier(foo, expression)
                                                                                 listener: handleNoTypeArguments(!)
@@ -80,7 +79,6 @@
                                                             parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                                                               parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                                                 parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                                                  isNextIdentifier(.)
                                                                   ensureIdentifier(., expressionContinuation)
                                                                     listener: handleIdentifier(bar, expressionContinuation)
                                                                   listener: handleNoTypeArguments(!)
@@ -98,7 +96,6 @@
                                                         parsePrimary([, expression, ConstantPatternContext.none)
                                                           parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                                             parseSend([, expression, ConstantPatternContext.none)
-                                                              isNextIdentifier([)
                                                               ensureIdentifier([, expression)
                                                                 listener: handleIdentifier(arg, expression)
                                                               listener: handleNoTypeArguments(])
@@ -118,7 +115,6 @@
                                 parsePrimary([, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                     parseSend([, expression, ConstantPatternContext.none)
-                                      isNextIdentifier([)
                                       ensureIdentifier([, expression)
                                         listener: handleIdentifier(arg2, expression)
                                       listener: handleNoTypeArguments(])
@@ -128,7 +124,7 @@
                           listener: handleIndexedExpression(null, [, ])
                     ensureSemicolon(])
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(f, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/nullCheckOnIndex_with_parens.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/nullCheckOnIndex_with_parens.dart.intertwined.expect
index ad03538..31e46f0 100644
--- a/pkg/front_end/parser_testcases/nnbd/nullCheckOnIndex_with_parens.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/nullCheckOnIndex_with_parens.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -46,7 +46,6 @@
                                       parsePrimary((, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                           parseSend((, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(()
                                             ensureIdentifier((, expression)
                                               listener: handleIdentifier(obj, expression)
                                             listener: handleNoTypeArguments(!)
@@ -63,7 +62,6 @@
                                 parsePrimary([, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral([, expression, ConstantPatternContext.none)
                                     parseSend([, expression, ConstantPatternContext.none)
-                                      isNextIdentifier([)
                                       ensureIdentifier([, expression)
                                         listener: handleIdentifier(arg, expression)
                                       listener: handleNoTypeArguments(])
@@ -73,7 +71,7 @@
                           listener: handleIndexedExpression(null, [, ])
                     ensureSemicolon(])
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(f, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/null_shorting_index.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/null_shorting_index.dart.intertwined.expect
index f29f13a..c749146 100644
--- a/pkg/front_end/parser_testcases/nnbd/null_shorting_index.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/null_shorting_index.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Class1, DeclarationKind.Class, Class1)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Class1)
               parseMetadataStar({)
                 listener: beginMetadataStar(int)
@@ -71,7 +71,6 @@
                           parsePrimary(=>, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(=>, expression, ConstantPatternContext.none)
                               parseSend(=>, expression, ConstantPatternContext.none)
-                                isNextIdentifier(=>)
                                 ensureIdentifier(=>, expression)
                                   listener: handleIdentifier(index, expression)
                                 listener: handleNoTypeArguments(;)
@@ -83,7 +82,7 @@
                     inGenerator()
                 listener: endClassMethod(null, int, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class1)
               parseMetadataStar(;)
                 listener: beginMetadataStar(void)
@@ -133,11 +132,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassMethod(null, void, (, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 2, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -165,7 +164,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, Class1)
+          notEofOrType(CLOSE_CURLY_BRACKET, Class1)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -186,7 +185,7 @@
                     listener: endInitializedIdentifier(c1)
                   ensureSemicolon(c1)
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, c1)
+          notEofOrType(CLOSE_CURLY_BRACKET, c1)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -198,7 +197,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(c1, expression)
                               listener: handleNoTypeArguments(?.)
@@ -218,7 +216,7 @@
                       listener: handleEndingBinaryExpression(?., ])
                   ensureSemicolon(])
                   listener: handleExpressionStatement(c1, ;)
-          notEofOrValue(}, c1)
+          notEofOrType(CLOSE_CURLY_BRACKET, c1)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -230,7 +228,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(c1, expression)
                               listener: handleNoTypeArguments(?.)
@@ -256,7 +253,7 @@
                       listener: handleAssignmentExpression(=, 1)
                   ensureSemicolon(1)
                   listener: handleExpressionStatement(c1, ;)
-          notEofOrValue(}, c1)
+          notEofOrType(CLOSE_CURLY_BRACKET, c1)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -268,7 +265,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(c1, expression)
                               listener: handleNoTypeArguments(?)
@@ -296,7 +292,7 @@
                         listener: handleIndexedExpression(?, [, ])
                   ensureSemicolon(])
                   listener: handleExpressionStatement(c1, ;)
-          notEofOrValue(}, c1)
+          notEofOrType(CLOSE_CURLY_BRACKET, c1)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -308,7 +304,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(c1, expression)
                               listener: handleNoTypeArguments(?)
@@ -346,7 +341,7 @@
                       listener: handleAssignmentExpression(=, 1)
                   ensureSemicolon(1)
                   listener: handleExpressionStatement(c1, ;)
-          notEofOrValue(}, c1)
+          notEofOrType(CLOSE_CURLY_BRACKET, c1)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -358,7 +353,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(c1, expression)
                               listener: handleNoTypeArguments(?)
@@ -386,7 +380,7 @@
                         listener: handleIndexedExpression(?, [, ])
                   ensureSemicolon(])
                   listener: handleExpressionStatement(c1, ;)
-          notEofOrValue(}, c1)
+          notEofOrType(CLOSE_CURLY_BRACKET, c1)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -398,7 +392,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(c1, expression)
                               listener: handleNoTypeArguments(?)
@@ -436,7 +429,7 @@
                       listener: handleAssignmentExpression(=, 1)
                   ensureSemicolon(1)
                   listener: handleExpressionStatement(c1, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(7, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/required_member.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/required_member.dart.intertwined.expect
index 29f6de7..6bf556d6 100644
--- a/pkg/front_end/parser_testcases/nnbd/required_member.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/required_member.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, dynamic)
+          notEofOrType(CLOSE_CURLY_BRACKET, dynamic)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -50,7 +50,6 @@
                             parseUnaryExpression(=, true, ConstantPatternContext.none)
                               parsePrimary(=, expression, ConstantPatternContext.none)
                                 parseNewExpression(=)
-                                  isNextIdentifier(new)
                                   listener: beginNewExpression(new)
                                   parseConstructorReference(new, ConstructorReferenceContext.New, null)
                                     ensureIdentifier(new, constructorReference)
@@ -69,7 +68,7 @@
                       listener: endInitializedIdentifier(foo)
                     ensureSemicolon())
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(var, ;, null, var, null, null)
@@ -91,7 +90,6 @@
                             parsePrimary(=, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                 parseSend(=, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(=)
                                   ensureIdentifier(=, expression)
                                     listener: handleIdentifier(foo, expression)
                                   listener: handleNoTypeArguments(.)
@@ -102,7 +100,6 @@
                             inPlainSync()
                             parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                               parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                isNextIdentifier(.)
                                 ensureIdentifier(., expressionContinuation)
                                   inPlainSync()
                                   listener: handleIdentifier(required, expressionContinuation)
@@ -115,7 +112,7 @@
                     listener: endInitializedIdentifier(bar)
                   ensureSemicolon(required)
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, required)
+          notEofOrType(CLOSE_CURLY_BRACKET, required)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -130,7 +127,6 @@
                             parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                               looksLikeFunctionBody(;)
                               parseSend(;, expression, ConstantPatternContext.none)
-                                isNextIdentifier(;)
                                 ensureIdentifier(;, expression)
                                   inPlainSync()
                                   listener: handleIdentifier(required, expression)
@@ -143,7 +139,7 @@
                                 listener: handleSend(required, ))
                     ensureSemicolon())
                     listener: handleExpressionStatement(required, ;)
-          notEofOrValue(}, bar)
+          notEofOrType(CLOSE_CURLY_BRACKET, bar)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -156,7 +152,6 @@
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(bar, expression)
                               listener: handleNoTypeArguments(()
@@ -168,7 +163,7 @@
                               listener: handleSend(bar, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(bar, ;)
-          notEofOrValue(}, new)
+          notEofOrType(CLOSE_CURLY_BRACKET, new)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -180,7 +175,6 @@
                         parseUnaryExpression(;, true, ConstantPatternContext.none)
                           parsePrimary(;, expression, ConstantPatternContext.none)
                             parseNewExpression(;)
-                              isNextIdentifier(new)
                               listener: beginNewExpression(new)
                               parseConstructorReference(new, ConstructorReferenceContext.New, null)
                                 ensureIdentifier(new, constructorReference)
@@ -199,7 +193,6 @@
                           inPlainSync()
                           parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                             parseSend(., expressionContinuation, ConstantPatternContext.none)
-                              isNextIdentifier(.)
                               ensureIdentifier(., expressionContinuation)
                                 inPlainSync()
                                 listener: handleIdentifier(required, expressionContinuation)
@@ -213,7 +206,7 @@
                         listener: handleEndingBinaryExpression(., ))
                     ensureSemicolon())
                     listener: handleExpressionStatement(new, ;)
-          notEofOrValue(}, new)
+          notEofOrType(CLOSE_CURLY_BRACKET, new)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -225,7 +218,6 @@
                         parseUnaryExpression(;, true, ConstantPatternContext.none)
                           parsePrimary(;, expression, ConstantPatternContext.none)
                             parseNewExpression(;)
-                              isNextIdentifier(new)
                               listener: beginNewExpression(new)
                               parseConstructorReference(new, ConstructorReferenceContext.New, null)
                                 ensureIdentifier(new, constructorReference)
@@ -244,7 +236,6 @@
                           inPlainSync()
                           parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                             parseSend(., expressionContinuation, ConstantPatternContext.none)
-                              isNextIdentifier(.)
                               ensureIdentifier(., expressionContinuation)
                                 inPlainSync()
                                 listener: handleIdentifier(required, expressionContinuation)
@@ -255,7 +246,7 @@
                         listener: handleEndingBinaryExpression(., required)
                     ensureSemicolon(required)
                     listener: handleExpressionStatement(new, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(6, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
@@ -283,7 +274,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, print)
+          notEofOrType(CLOSE_CURLY_BRACKET, print)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -296,7 +287,6 @@
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(print, expression)
                               listener: handleNoTypeArguments(()
@@ -316,7 +306,7 @@
                               listener: handleSend(print, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(print, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(required, null, })
   listener: endTopLevelDeclaration(})
@@ -343,7 +333,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(X, DeclarationKind.Class, X)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, required)
+            notEofOrType(CLOSE_CURLY_BRACKET, required)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, X)
               parseMetadataStar({)
                 listener: beginMetadataStar(required)
@@ -370,7 +360,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, print)
+                  notEofOrType(CLOSE_CURLY_BRACKET, print)
                   parseStatement({)
                     parseStatementX({)
                       parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -383,7 +373,6 @@
                                   parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                                     looksLikeFunctionBody(;)
                                     parseSend({, expression, ConstantPatternContext.none)
-                                      isNextIdentifier({)
                                       ensureIdentifier({, expression)
                                         listener: handleIdentifier(print, expression)
                                       listener: handleNoTypeArguments(()
@@ -403,11 +392,11 @@
                                       listener: handleSend(print, ))
                           ensureSemicolon())
                           listener: handleExpressionStatement(print, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(null, required, (, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -434,7 +423,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Y, DeclarationKind.Class, Y)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Y)
               parseMetadataStar({)
                 listener: beginMetadataStar(int)
@@ -458,7 +447,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/nnbd/required_modifier.dart.intertwined.expect b/pkg/front_end/parser_testcases/nnbd/required_modifier.dart.intertwined.expect
index 6fe1f7cd..5bb1b79 100644
--- a/pkg/front_end/parser_testcases/nnbd/required_modifier.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/nnbd/required_modifier.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, dynamic)
+          notEofOrType(CLOSE_CURLY_BRACKET, dynamic)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -50,7 +50,6 @@
                             parseUnaryExpression(=, true, ConstantPatternContext.none)
                               parsePrimary(=, expression, ConstantPatternContext.none)
                                 parseNewExpression(=)
-                                  isNextIdentifier(new)
                                   listener: beginNewExpression(new)
                                   parseConstructorReference(new, ConstructorReferenceContext.New, null)
                                     ensureIdentifier(new, constructorReference)
@@ -69,7 +68,7 @@
                       listener: endInitializedIdentifier(foo)
                     ensureSemicolon())
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(var, ;, null, var, null, null)
@@ -91,7 +90,6 @@
                             parsePrimary(=, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                 parseSend(=, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(=)
                                   ensureIdentifier(=, expression)
                                     listener: handleIdentifier(foo, expression)
                                   listener: handleNoTypeArguments(.)
@@ -102,7 +100,6 @@
                             inPlainSync()
                             parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                               parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                isNextIdentifier(.)
                                 ensureIdentifier(., expressionContinuation)
                                   inPlainSync()
                                   listener: handleIdentifier(required, expressionContinuation)
@@ -115,7 +112,7 @@
                     listener: endInitializedIdentifier(bar)
                   ensureSemicolon(required)
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, required)
+          notEofOrType(CLOSE_CURLY_BRACKET, required)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -130,7 +127,6 @@
                             parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                               looksLikeFunctionBody(;)
                               parseSend(;, expression, ConstantPatternContext.none)
-                                isNextIdentifier(;)
                                 ensureIdentifier(;, expression)
                                   inPlainSync()
                                   listener: handleIdentifier(required, expression)
@@ -143,7 +139,7 @@
                                 listener: handleSend(required, ))
                     ensureSemicolon())
                     listener: handleExpressionStatement(required, ;)
-          notEofOrValue(}, bar)
+          notEofOrType(CLOSE_CURLY_BRACKET, bar)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -156,7 +152,6 @@
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(bar, expression)
                               listener: handleNoTypeArguments(()
@@ -168,7 +163,7 @@
                               listener: handleSend(bar, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(bar, ;)
-          notEofOrValue(}, new)
+          notEofOrType(CLOSE_CURLY_BRACKET, new)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -180,7 +175,6 @@
                         parseUnaryExpression(;, true, ConstantPatternContext.none)
                           parsePrimary(;, expression, ConstantPatternContext.none)
                             parseNewExpression(;)
-                              isNextIdentifier(new)
                               listener: beginNewExpression(new)
                               parseConstructorReference(new, ConstructorReferenceContext.New, null)
                                 ensureIdentifier(new, constructorReference)
@@ -199,7 +193,6 @@
                           inPlainSync()
                           parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                             parseSend(., expressionContinuation, ConstantPatternContext.none)
-                              isNextIdentifier(.)
                               ensureIdentifier(., expressionContinuation)
                                 inPlainSync()
                                 listener: handleIdentifier(required, expressionContinuation)
@@ -213,7 +206,7 @@
                         listener: handleEndingBinaryExpression(., ))
                     ensureSemicolon())
                     listener: handleExpressionStatement(new, ;)
-          notEofOrValue(}, new)
+          notEofOrType(CLOSE_CURLY_BRACKET, new)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -225,7 +218,6 @@
                         parseUnaryExpression(;, true, ConstantPatternContext.none)
                           parsePrimary(;, expression, ConstantPatternContext.none)
                             parseNewExpression(;)
-                              isNextIdentifier(new)
                               listener: beginNewExpression(new)
                               parseConstructorReference(new, ConstructorReferenceContext.New, null)
                                 ensureIdentifier(new, constructorReference)
@@ -244,7 +236,6 @@
                           inPlainSync()
                           parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                             parseSend(., expressionContinuation, ConstantPatternContext.none)
-                              isNextIdentifier(.)
                               ensureIdentifier(., expressionContinuation)
                                 inPlainSync()
                                 listener: handleIdentifier(required, expressionContinuation)
@@ -255,7 +246,7 @@
                         listener: handleEndingBinaryExpression(., required)
                     ensureSemicolon(required)
                     listener: handleExpressionStatement(new, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(6, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
@@ -299,7 +290,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, print)
+          notEofOrType(CLOSE_CURLY_BRACKET, print)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -312,7 +303,6 @@
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(print, expression)
                               listener: handleNoTypeArguments(()
@@ -332,7 +322,7 @@
                               listener: handleSend(print, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(print, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(required, null, })
   listener: endTopLevelDeclaration(})
@@ -359,7 +349,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(X, DeclarationKind.Class, X)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, required)
+            notEofOrType(CLOSE_CURLY_BRACKET, required)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, X)
               parseMetadataStar({)
                 listener: beginMetadataStar(required)
@@ -386,7 +376,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, print)
+                  notEofOrType(CLOSE_CURLY_BRACKET, print)
                   parseStatement({)
                     parseStatementX({)
                       parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -399,7 +389,6 @@
                                   parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                                     looksLikeFunctionBody(;)
                                     parseSend({, expression, ConstantPatternContext.none)
-                                      isNextIdentifier({)
                                       ensureIdentifier({, expression)
                                         listener: handleIdentifier(print, expression)
                                       listener: handleNoTypeArguments(()
@@ -419,11 +408,11 @@
                                       listener: handleSend(print, ))
                           ensureSemicolon())
                           listener: handleExpressionStatement(print, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(null, required, (, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -450,7 +439,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Y, DeclarationKind.Class, Y)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Y)
               parseMetadataStar({)
                 listener: beginMetadataStar(int)
@@ -474,7 +463,7 @@
                   listener: endFieldInitializer(=, 42)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/no-triple-shift/define_triple_shift_method.dart.intertwined.expect b/pkg/front_end/parser_testcases/no-triple-shift/define_triple_shift_method.dart.intertwined.expect
index f58580a..7ff7ea2 100644
--- a/pkg/front_end/parser_testcases/no-triple-shift/define_triple_shift_method.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/no-triple-shift/define_triple_shift_method.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Foo, DeclarationKind.Class, Foo)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, Foo)
+            notEofOrType(CLOSE_CURLY_BRACKET, Foo)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Foo)
               parseMetadataStar({)
                 listener: beginMetadataStar(Foo)
@@ -77,7 +77,7 @@
                     inGenerator()
                 listener: endClassMethod(null, Foo, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -105,7 +105,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, Foo)
+          notEofOrType(CLOSE_CURLY_BRACKET, Foo)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -128,7 +128,6 @@
                           parseUnaryExpression(=, true, ConstantPatternContext.none)
                             parsePrimary(=, expression, ConstantPatternContext.none)
                               parseNewExpression(=)
-                                isNextIdentifier(new)
                                 listener: beginNewExpression(new)
                                 parseConstructorReference(new, ConstructorReferenceContext.New, null)
                                   ensureIdentifier(new, constructorReference)
@@ -147,7 +146,7 @@
                     listener: endInitializedIdentifier(foo)
                   ensureSemicolon())
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, foo)
+          notEofOrType(CLOSE_CURLY_BRACKET, foo)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -159,7 +158,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(foo, expression)
                               listener: handleNoTypeArguments(>>)
@@ -178,7 +176,7 @@
                       listener: endBinaryExpression(>>>, 42)
                   ensureSemicolon(42)
                   listener: handleExpressionStatement(foo, ;)
-          notEofOrValue(}, print)
+          notEofOrType(CLOSE_CURLY_BRACKET, print)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -191,7 +189,6 @@
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(print, expression)
                               listener: handleNoTypeArguments(()
@@ -205,7 +202,6 @@
                                           parsePrimary((, expression, ConstantPatternContext.none)
                                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                               parseSend((, expression, ConstantPatternContext.none)
-                                                isNextIdentifier(()
                                                 ensureIdentifier((, expression)
                                                   listener: handleIdentifier(foo, expression)
                                                 listener: handleNoTypeArguments(>>)
@@ -226,7 +222,7 @@
                               listener: handleSend(print, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(print, ;)
-          notEofOrValue(}, print)
+          notEofOrType(CLOSE_CURLY_BRACKET, print)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -239,7 +235,6 @@
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(print, expression)
                               listener: handleNoTypeArguments(()
@@ -253,7 +248,6 @@
                                           parsePrimary((, expression, ConstantPatternContext.none)
                                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                               parseSend((, expression, ConstantPatternContext.none)
-                                                isNextIdentifier(()
                                                 ensureIdentifier((, expression)
                                                   listener: handleIdentifier(foo, expression)
                                                 listener: handleNoTypeArguments(>>)
@@ -273,7 +267,7 @@
                               listener: handleSend(print, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(print, ;)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement(;)
             parseStatementX(;)
               parseIfStatement(;)
@@ -293,7 +287,6 @@
                                       parsePrimary((, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                           parseSend((, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(()
                                             ensureIdentifier((, expression)
                                               listener: handleIdentifier(foo, expression)
                                             listener: handleNoTypeArguments(>>)
@@ -317,7 +310,6 @@
                             parsePrimary(==, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(==, expression, ConstantPatternContext.none)
                                 parseSend(==, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(==)
                                   ensureIdentifier(==, expression)
                                     listener: handleIdentifier(foo, expression)
                                   listener: handleNoTypeArguments())
@@ -333,7 +325,7 @@
                     parseBlock(), BlockKind(statement))
                       ensureBlock(), BlockKind(statement))
                       listener: beginBlock({, BlockKind(statement))
-                      notEofOrValue(}, print)
+                      notEofOrType(CLOSE_CURLY_BRACKET, print)
                       parseStatement({)
                         parseStatementX({)
                           parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -346,7 +338,6 @@
                                       parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                                         looksLikeFunctionBody(;)
                                         parseSend({, expression, ConstantPatternContext.none)
-                                          isNextIdentifier({)
                                           ensureIdentifier({, expression)
                                             listener: handleIdentifier(print, expression)
                                           listener: handleNoTypeArguments(()
@@ -366,11 +357,11 @@
                                           listener: handleSend(print, ))
                               ensureSemicolon())
                               listener: handleExpressionStatement(print, ;)
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlock(1, {, }, BlockKind(statement))
                 listener: endThenStatement({, })
                 listener: endIfStatement(if, null, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(5, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/no-triple-shift/define_triple_shift_method_prime.dart.intertwined.expect b/pkg/front_end/parser_testcases/no-triple-shift/define_triple_shift_method_prime.dart.intertwined.expect
index cd5676a..63af972 100644
--- a/pkg/front_end/parser_testcases/no-triple-shift/define_triple_shift_method_prime.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/no-triple-shift/define_triple_shift_method_prime.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Foo, DeclarationKind.Class, Foo)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, Foo)
+            notEofOrType(CLOSE_CURLY_BRACKET, Foo)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Foo)
               parseMetadataStar({)
                 listener: beginMetadataStar(Foo)
@@ -74,7 +74,7 @@
                     inGenerator()
                 listener: endClassMethod(null, Foo, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -102,7 +102,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, Foo)
+          notEofOrType(CLOSE_CURLY_BRACKET, Foo)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -125,7 +125,6 @@
                           parseUnaryExpression(=, true, ConstantPatternContext.none)
                             parsePrimary(=, expression, ConstantPatternContext.none)
                               parseNewExpression(=)
-                                isNextIdentifier(new)
                                 listener: beginNewExpression(new)
                                 parseConstructorReference(new, ConstructorReferenceContext.New, null)
                                   ensureIdentifier(new, constructorReference)
@@ -144,7 +143,7 @@
                     listener: endInitializedIdentifier(foo)
                   ensureSemicolon())
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, foo)
+          notEofOrType(CLOSE_CURLY_BRACKET, foo)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -156,7 +155,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(foo, expression)
                               listener: handleNoTypeArguments(>>)
@@ -172,7 +170,7 @@
                       listener: endBinaryExpression(>>, 42)
                   ensureSemicolon(42)
                   listener: handleExpressionStatement(foo, ;)
-          notEofOrValue(}, print)
+          notEofOrType(CLOSE_CURLY_BRACKET, print)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -185,7 +183,6 @@
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(print, expression)
                               listener: handleNoTypeArguments(()
@@ -199,7 +196,6 @@
                                           parsePrimary((, expression, ConstantPatternContext.none)
                                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                               parseSend((, expression, ConstantPatternContext.none)
-                                                isNextIdentifier(()
                                                 ensureIdentifier((, expression)
                                                   listener: handleIdentifier(foo, expression)
                                                 listener: handleNoTypeArguments(>>)
@@ -217,7 +213,7 @@
                               listener: handleSend(print, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(print, ;)
-          notEofOrValue(}, print)
+          notEofOrType(CLOSE_CURLY_BRACKET, print)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -230,7 +226,6 @@
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(print, expression)
                               listener: handleNoTypeArguments(()
@@ -244,7 +239,6 @@
                                           parsePrimary((, expression, ConstantPatternContext.none)
                                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                               parseSend((, expression, ConstantPatternContext.none)
-                                                isNextIdentifier(()
                                                 ensureIdentifier((, expression)
                                                   listener: handleIdentifier(foo, expression)
                                                 listener: handleNoTypeArguments(>>=)
@@ -261,7 +255,7 @@
                               listener: handleSend(print, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(print, ;)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement(;)
             parseStatementX(;)
               parseIfStatement(;)
@@ -281,7 +275,6 @@
                                       parsePrimary((, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                           parseSend((, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(()
                                             ensureIdentifier((, expression)
                                               listener: handleIdentifier(foo, expression)
                                             listener: handleNoTypeArguments(>>=)
@@ -302,7 +295,6 @@
                             parsePrimary(==, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(==, expression, ConstantPatternContext.none)
                                 parseSend(==, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(==)
                                   ensureIdentifier(==, expression)
                                     listener: handleIdentifier(foo, expression)
                                   listener: handleNoTypeArguments())
@@ -318,7 +310,7 @@
                     parseBlock(), BlockKind(statement))
                       ensureBlock(), BlockKind(statement))
                       listener: beginBlock({, BlockKind(statement))
-                      notEofOrValue(}, print)
+                      notEofOrType(CLOSE_CURLY_BRACKET, print)
                       parseStatement({)
                         parseStatementX({)
                           parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -331,7 +323,6 @@
                                       parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                                         looksLikeFunctionBody(;)
                                         parseSend({, expression, ConstantPatternContext.none)
-                                          isNextIdentifier({)
                                           ensureIdentifier({, expression)
                                             listener: handleIdentifier(print, expression)
                                           listener: handleNoTypeArguments(()
@@ -351,11 +342,11 @@
                                           listener: handleSend(print, ))
                               ensureSemicolon())
                               listener: handleExpressionStatement(print, ;)
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlock(1, {, }, BlockKind(statement))
                 listener: endThenStatement({, })
                 listener: endIfStatement(if, null, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(5, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/no-triple-shift/simple_attempted_usage_of_triple_shift.dart.intertwined.expect b/pkg/front_end/parser_testcases/no-triple-shift/simple_attempted_usage_of_triple_shift.dart.intertwined.expect
index a8783ba..810d846 100644
--- a/pkg/front_end/parser_testcases/no-triple-shift/simple_attempted_usage_of_triple_shift.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/no-triple-shift/simple_attempted_usage_of_triple_shift.dart.intertwined.expect
@@ -41,7 +41,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
@@ -77,7 +77,7 @@
                     listener: endInitializedIdentifier(x)
                   ensureSemicolon(2)
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, print)
+          notEofOrType(CLOSE_CURLY_BRACKET, print)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -90,7 +90,6 @@
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(print, expression)
                               listener: handleNoTypeArguments(()
@@ -107,7 +106,6 @@
                                                 listener: beginLiteralString('x: )
                                                 parseIdentifierExpression($)
                                                   parseSend($, expression, ConstantPatternContext.none)
-                                                    isNextIdentifier($)
                                                     ensureIdentifier($, expression)
                                                       listener: handleIdentifier(x, expression)
                                                     listener: handleNoTypeArguments(')
@@ -122,7 +120,7 @@
                               listener: handleSend(print, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(print, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/no-triple-shift/triple_shift_not_triple_shift.dart.intertwined.expect b/pkg/front_end/parser_testcases/no-triple-shift/triple_shift_not_triple_shift.dart.intertwined.expect
index 256deed..7161caa 100644
--- a/pkg/front_end/parser_testcases/no-triple-shift/triple_shift_not_triple_shift.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/no-triple-shift/triple_shift_not_triple_shift.dart.intertwined.expect
@@ -17,7 +17,7 @@
           listener: handleType(Symbol, null)
           parseClassOrMixinOrExtensionBody(Symbol, DeclarationKind.Extension, null)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Extension, {)
-            notEofOrValue(}, String)
+            notEofOrType(CLOSE_CURLY_BRACKET, String)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Extension, null)
               parseMetadataStar({)
                 listener: beginMetadataStar(String)
@@ -68,7 +68,7 @@
                     inGenerator()
                 listener: endExtensionMethod(null, String, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, String)
+            notEofOrType(CLOSE_CURLY_BRACKET, String)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Extension, null)
               parseMetadataStar(;)
                 listener: beginMetadataStar(String)
@@ -120,7 +120,7 @@
                     inGenerator()
                 listener: endExtensionMethod(null, String, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Extension, 2, {, })
           listener: endExtensionDeclaration(extension, extension, on, })
   listener: endTopLevelDeclaration(})
@@ -147,7 +147,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, print)
+          notEofOrType(CLOSE_CURLY_BRACKET, print)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -160,7 +160,6 @@
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(print, expression)
                               listener: handleNoTypeArguments(()
@@ -196,7 +195,7 @@
                               listener: handleSend(print, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(print, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -240,7 +239,7 @@
             listener: handleClassHeader(abstract, class, null)
           parseClassOrMixinOrExtensionBody(>, DeclarationKind.Class, Foo)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(abstract, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/no-triple-shift/triple_shift_symbol.dart.intertwined.expect b/pkg/front_end/parser_testcases/no-triple-shift/triple_shift_symbol.dart.intertwined.expect
index 48506ee..ef88eff 100644
--- a/pkg/front_end/parser_testcases/no-triple-shift/triple_shift_symbol.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/no-triple-shift/triple_shift_symbol.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, print)
+          notEofOrType(CLOSE_CURLY_BRACKET, print)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -39,7 +39,6 @@
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(print, expression)
                               listener: handleNoTypeArguments(()
@@ -60,7 +59,6 @@
                                           parseUnaryExpression(>, true, ConstantPatternContext.none)
                                             parsePrimary(>, expression, ConstantPatternContext.none)
                                               parseSend(>, expression, ConstantPatternContext.none)
-                                                isNextIdentifier(>)
                                                 ensureIdentifier(>, expression)
                                                   reportRecoverableErrorWithToken(), Template(ExpectedIdentifier))
                                                     listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got ')'., Try inserting an identifier before ')'., {lexeme: )}], ), ))
@@ -75,7 +73,7 @@
                               listener: handleSend(print, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(print, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/null_aware_elements/nested.dart.intertwined.expect b/pkg/front_end/parser_testcases/null_aware_elements/nested.dart.intertwined.expect
index 2ba3721..cb131e0 100644
--- a/pkg/front_end/parser_testcases/null_aware_elements/nested.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/null_aware_elements/nested.dart.intertwined.expect
@@ -81,7 +81,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement({)
             parseStatementX({)
               parseReturnStatement({)
@@ -119,7 +119,6 @@
                                   parsePrimary(in, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(in, expression, ConstantPatternContext.none)
                                       parseSend(in, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(in)
                                         ensureIdentifier(in, expression)
                                           listener: handleIdentifier(list, expression)
                                         listener: handleNoTypeArguments())
@@ -139,7 +138,6 @@
                                       parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                         looksLikeFunctionBody())
                                         parseSend((, expression, ConstantPatternContext.none)
-                                          isNextIdentifier(()
                                           ensureIdentifier((, expression)
                                             listener: handleIdentifier(p, expression)
                                           listener: handleNoTypeArguments(()
@@ -153,7 +151,6 @@
                                                       parsePrimary((, expression, ConstantPatternContext.none)
                                                         parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                           parseSend((, expression, ConstantPatternContext.none)
-                                                            isNextIdentifier(()
                                                             ensureIdentifier((, expression)
                                                               listener: handleIdentifier(element, expression)
                                                             listener: handleNoTypeArguments())
@@ -171,7 +168,6 @@
                                 parsePrimary(?, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(?, expression, ConstantPatternContext.none)
                                     parseSend(?, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(?)
                                       ensureIdentifier(?, expression)
                                         listener: handleIdentifier(a, expression)
                                       listener: handleNoTypeArguments(})
@@ -185,7 +181,7 @@
                 ensureSemicolon(})
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test1, null, })
   listener: endTopLevelDeclaration(})
@@ -280,7 +276,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement({)
             parseStatementX({)
               parseReturnStatement({)
@@ -318,7 +314,6 @@
                                   parsePrimary(in, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(in, expression, ConstantPatternContext.none)
                                       parseSend(in, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(in)
                                         ensureIdentifier(in, expression)
                                           listener: handleIdentifier(list, expression)
                                         listener: handleNoTypeArguments())
@@ -338,7 +333,6 @@
                                       parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                         looksLikeFunctionBody())
                                         parseSend((, expression, ConstantPatternContext.none)
-                                          isNextIdentifier(()
                                           ensureIdentifier((, expression)
                                             listener: handleIdentifier(p, expression)
                                           listener: handleNoTypeArguments(()
@@ -352,7 +346,6 @@
                                                       parsePrimary((, expression, ConstantPatternContext.none)
                                                         parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                           parseSend((, expression, ConstantPatternContext.none)
-                                                            isNextIdentifier(()
                                                             ensureIdentifier((, expression)
                                                               listener: handleIdentifier(element, expression)
                                                             listener: handleNoTypeArguments())
@@ -370,7 +363,6 @@
                                 parsePrimary(?, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(?, expression, ConstantPatternContext.none)
                                     parseSend(?, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(?)
                                       ensureIdentifier(?, expression)
                                         listener: handleIdentifier(a, expression)
                                       listener: handleNoTypeArguments(else)
@@ -385,7 +377,6 @@
                                 parsePrimary(?, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(?, expression, ConstantPatternContext.none)
                                     parseSend(?, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(?)
                                       ensureIdentifier(?, expression)
                                         listener: handleIdentifier(b, expression)
                                       listener: handleNoTypeArguments(})
@@ -399,7 +390,7 @@
                 ensureSemicolon(})
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test2, null, })
   listener: endTopLevelDeclaration(})
@@ -463,7 +454,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement({)
             parseStatementX({)
               parseReturnStatement({)
@@ -483,7 +474,6 @@
                                     parsePrimary((, expression, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                         parseSend((, expression, ConstantPatternContext.none)
-                                          isNextIdentifier(()
                                           ensureIdentifier((, expression)
                                             listener: handleIdentifier(t, expression)
                                           listener: handleNoTypeArguments())
@@ -520,7 +510,6 @@
                                   parsePrimary(in, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(in, expression, ConstantPatternContext.none)
                                       parseSend(in, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(in)
                                         ensureIdentifier(in, expression)
                                           listener: handleIdentifier(list, expression)
                                         listener: handleNoTypeArguments())
@@ -536,7 +525,6 @@
                                 parsePrimary(?, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(?, expression, ConstantPatternContext.none)
                                     parseSend(?, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(?)
                                       ensureIdentifier(?, expression)
                                         listener: handleIdentifier(a, expression)
                                       listener: handleNoTypeArguments(})
@@ -550,7 +538,7 @@
                 ensureSemicolon(})
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test3, null, })
   listener: endTopLevelDeclaration(})
@@ -626,7 +614,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement({)
             parseStatementX({)
               parseReturnStatement({)
@@ -646,7 +634,6 @@
                                     parsePrimary((, expression, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                         parseSend((, expression, ConstantPatternContext.none)
-                                          isNextIdentifier(()
                                           ensureIdentifier((, expression)
                                             listener: handleIdentifier(t, expression)
                                           listener: handleNoTypeArguments())
@@ -683,7 +670,6 @@
                                   parsePrimary(in, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(in, expression, ConstantPatternContext.none)
                                       parseSend(in, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(in)
                                         ensureIdentifier(in, expression)
                                           listener: handleIdentifier(list, expression)
                                         listener: handleNoTypeArguments())
@@ -699,7 +685,6 @@
                                 parsePrimary(?, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(?, expression, ConstantPatternContext.none)
                                     parseSend(?, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(?)
                                       ensureIdentifier(?, expression)
                                         listener: handleIdentifier(a, expression)
                                       listener: handleNoTypeArguments(else)
@@ -736,7 +721,6 @@
                                   parsePrimary(in, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(in, expression, ConstantPatternContext.none)
                                       parseSend(in, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(in)
                                         ensureIdentifier(in, expression)
                                           listener: handleIdentifier(list, expression)
                                         listener: handleNoTypeArguments())
@@ -752,7 +736,6 @@
                                 parsePrimary(?, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(?, expression, ConstantPatternContext.none)
                                     parseSend(?, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(?)
                                       ensureIdentifier(?, expression)
                                         listener: handleIdentifier(b, expression)
                                       listener: handleNoTypeArguments(})
@@ -766,7 +749,7 @@
                 ensureSemicolon(})
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test4, null, })
   listener: endTopLevelDeclaration(})
@@ -849,7 +832,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement({)
             parseStatementX({)
               parseReturnStatement({)
@@ -887,7 +870,6 @@
                                   parsePrimary(in, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(in, expression, ConstantPatternContext.none)
                                       parseSend(in, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(in)
                                         ensureIdentifier(in, expression)
                                           listener: handleIdentifier(list, expression)
                                         listener: handleNoTypeArguments())
@@ -907,7 +889,6 @@
                                       parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                         looksLikeFunctionBody())
                                         parseSend((, expression, ConstantPatternContext.none)
-                                          isNextIdentifier(()
                                           ensureIdentifier((, expression)
                                             listener: handleIdentifier(p, expression)
                                           listener: handleNoTypeArguments(()
@@ -921,7 +902,6 @@
                                                       parsePrimary((, expression, ConstantPatternContext.none)
                                                         parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                           parseSend((, expression, ConstantPatternContext.none)
-                                                            isNextIdentifier(()
                                                             ensureIdentifier((, expression)
                                                               listener: handleIdentifier(element, expression)
                                                             listener: handleNoTypeArguments())
@@ -939,7 +919,6 @@
                                 parsePrimary(?, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(?, expression, ConstantPatternContext.none)
                                     parseSend(?, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(?)
                                       ensureIdentifier(?, expression)
                                         listener: handleIdentifier(a, expression)
                                       listener: handleNoTypeArguments(:)
@@ -961,7 +940,7 @@
                 ensureSemicolon(})
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test5, null, })
   listener: endTopLevelDeclaration(})
@@ -1056,7 +1035,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement({)
             parseStatementX({)
               parseReturnStatement({)
@@ -1094,7 +1073,6 @@
                                   parsePrimary(in, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(in, expression, ConstantPatternContext.none)
                                       parseSend(in, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(in)
                                         ensureIdentifier(in, expression)
                                           listener: handleIdentifier(list, expression)
                                         listener: handleNoTypeArguments())
@@ -1114,7 +1092,6 @@
                                       parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                         looksLikeFunctionBody())
                                         parseSend((, expression, ConstantPatternContext.none)
-                                          isNextIdentifier(()
                                           ensureIdentifier((, expression)
                                             listener: handleIdentifier(p, expression)
                                           listener: handleNoTypeArguments(()
@@ -1128,7 +1105,6 @@
                                                       parsePrimary((, expression, ConstantPatternContext.none)
                                                         parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                           parseSend((, expression, ConstantPatternContext.none)
-                                                            isNextIdentifier(()
                                                             ensureIdentifier((, expression)
                                                               listener: handleIdentifier(element, expression)
                                                             listener: handleNoTypeArguments())
@@ -1146,7 +1122,6 @@
                                 parsePrimary(?, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(?, expression, ConstantPatternContext.none)
                                     parseSend(?, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(?)
                                       ensureIdentifier(?, expression)
                                         listener: handleIdentifier(a, expression)
                                       listener: handleNoTypeArguments(:)
@@ -1169,7 +1144,6 @@
                                 parsePrimary(?, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(?, expression, ConstantPatternContext.none)
                                     parseSend(?, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(?)
                                       ensureIdentifier(?, expression)
                                         listener: handleIdentifier(b, expression)
                                       listener: handleNoTypeArguments(:)
@@ -1191,7 +1165,7 @@
                 ensureSemicolon(})
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test6, null, })
   listener: endTopLevelDeclaration(})
@@ -1255,7 +1229,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement({)
             parseStatementX({)
               parseReturnStatement({)
@@ -1275,7 +1249,6 @@
                                     parsePrimary((, expression, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                         parseSend((, expression, ConstantPatternContext.none)
-                                          isNextIdentifier(()
                                           ensureIdentifier((, expression)
                                             listener: handleIdentifier(t, expression)
                                           listener: handleNoTypeArguments())
@@ -1312,7 +1285,6 @@
                                   parsePrimary(in, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(in, expression, ConstantPatternContext.none)
                                       parseSend(in, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(in)
                                         ensureIdentifier(in, expression)
                                           listener: handleIdentifier(list, expression)
                                         listener: handleNoTypeArguments())
@@ -1328,7 +1300,6 @@
                                 parsePrimary(?, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(?, expression, ConstantPatternContext.none)
                                     parseSend(?, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(?)
                                       ensureIdentifier(?, expression)
                                         listener: handleIdentifier(a, expression)
                                       listener: handleNoTypeArguments(:)
@@ -1350,7 +1321,7 @@
                 ensureSemicolon(})
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test7, null, })
   listener: endTopLevelDeclaration(})
@@ -1426,7 +1397,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement({)
             parseStatementX({)
               parseReturnStatement({)
@@ -1446,7 +1417,6 @@
                                     parsePrimary((, expression, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                         parseSend((, expression, ConstantPatternContext.none)
-                                          isNextIdentifier(()
                                           ensureIdentifier((, expression)
                                             listener: handleIdentifier(t, expression)
                                           listener: handleNoTypeArguments())
@@ -1483,7 +1453,6 @@
                                   parsePrimary(in, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(in, expression, ConstantPatternContext.none)
                                       parseSend(in, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(in)
                                         ensureIdentifier(in, expression)
                                           listener: handleIdentifier(list, expression)
                                         listener: handleNoTypeArguments())
@@ -1499,7 +1468,6 @@
                                 parsePrimary(?, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(?, expression, ConstantPatternContext.none)
                                     parseSend(?, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(?)
                                       ensureIdentifier(?, expression)
                                         listener: handleIdentifier(a, expression)
                                       listener: handleNoTypeArguments(:)
@@ -1544,7 +1512,6 @@
                                   parsePrimary(in, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(in, expression, ConstantPatternContext.none)
                                       parseSend(in, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(in)
                                         ensureIdentifier(in, expression)
                                           listener: handleIdentifier(list, expression)
                                         listener: handleNoTypeArguments())
@@ -1560,7 +1527,6 @@
                                 parsePrimary(?, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(?, expression, ConstantPatternContext.none)
                                     parseSend(?, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(?)
                                       ensureIdentifier(?, expression)
                                         listener: handleIdentifier(b, expression)
                                       listener: handleNoTypeArguments(:)
@@ -1582,7 +1548,7 @@
                 ensureSemicolon(})
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test8, null, })
   listener: endTopLevelDeclaration(})
@@ -1665,7 +1631,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement({)
             parseStatementX({)
               parseReturnStatement({)
@@ -1703,7 +1669,6 @@
                                   parsePrimary(in, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(in, expression, ConstantPatternContext.none)
                                       parseSend(in, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(in)
                                         ensureIdentifier(in, expression)
                                           listener: handleIdentifier(list, expression)
                                         listener: handleNoTypeArguments())
@@ -1723,7 +1688,6 @@
                                       parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                         looksLikeFunctionBody())
                                         parseSend((, expression, ConstantPatternContext.none)
-                                          isNextIdentifier(()
                                           ensureIdentifier((, expression)
                                             listener: handleIdentifier(p, expression)
                                           listener: handleNoTypeArguments(()
@@ -1737,7 +1701,6 @@
                                                       parsePrimary((, expression, ConstantPatternContext.none)
                                                         parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                           parseSend((, expression, ConstantPatternContext.none)
-                                                            isNextIdentifier(()
                                                             ensureIdentifier((, expression)
                                                               listener: handleIdentifier(element, expression)
                                                             listener: handleNoTypeArguments())
@@ -1763,7 +1726,6 @@
                                 parsePrimary(?, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(?, expression, ConstantPatternContext.none)
                                     parseSend(?, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(?)
                                       ensureIdentifier(?, expression)
                                         listener: handleIdentifier(a, expression)
                                       listener: handleNoTypeArguments(})
@@ -1777,7 +1739,7 @@
                 ensureSemicolon(})
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test9, null, })
   listener: endTopLevelDeclaration(})
@@ -1872,7 +1834,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement({)
             parseStatementX({)
               parseReturnStatement({)
@@ -1910,7 +1872,6 @@
                                   parsePrimary(in, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(in, expression, ConstantPatternContext.none)
                                       parseSend(in, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(in)
                                         ensureIdentifier(in, expression)
                                           listener: handleIdentifier(list, expression)
                                         listener: handleNoTypeArguments())
@@ -1930,7 +1891,6 @@
                                       parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                         looksLikeFunctionBody())
                                         parseSend((, expression, ConstantPatternContext.none)
-                                          isNextIdentifier(()
                                           ensureIdentifier((, expression)
                                             listener: handleIdentifier(p, expression)
                                           listener: handleNoTypeArguments(()
@@ -1944,7 +1904,6 @@
                                                       parsePrimary((, expression, ConstantPatternContext.none)
                                                         parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                           parseSend((, expression, ConstantPatternContext.none)
-                                                            isNextIdentifier(()
                                                             ensureIdentifier((, expression)
                                                               listener: handleIdentifier(element, expression)
                                                             listener: handleNoTypeArguments())
@@ -1970,7 +1929,6 @@
                                 parsePrimary(?, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(?, expression, ConstantPatternContext.none)
                                     parseSend(?, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(?)
                                       ensureIdentifier(?, expression)
                                         listener: handleIdentifier(a, expression)
                                       listener: handleNoTypeArguments(else)
@@ -1993,7 +1951,6 @@
                                 parsePrimary(?, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(?, expression, ConstantPatternContext.none)
                                     parseSend(?, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(?)
                                       ensureIdentifier(?, expression)
                                         listener: handleIdentifier(b, expression)
                                       listener: handleNoTypeArguments(})
@@ -2007,7 +1964,7 @@
                 ensureSemicolon(})
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test10, null, })
   listener: endTopLevelDeclaration(})
@@ -2071,7 +2028,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement({)
             parseStatementX({)
               parseReturnStatement({)
@@ -2091,7 +2048,6 @@
                                     parsePrimary((, expression, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                         parseSend((, expression, ConstantPatternContext.none)
-                                          isNextIdentifier(()
                                           ensureIdentifier((, expression)
                                             listener: handleIdentifier(t, expression)
                                           listener: handleNoTypeArguments())
@@ -2128,7 +2084,6 @@
                                   parsePrimary(in, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(in, expression, ConstantPatternContext.none)
                                       parseSend(in, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(in)
                                         ensureIdentifier(in, expression)
                                           listener: handleIdentifier(list, expression)
                                         listener: handleNoTypeArguments())
@@ -2152,7 +2107,6 @@
                                 parsePrimary(?, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(?, expression, ConstantPatternContext.none)
                                     parseSend(?, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(?)
                                       ensureIdentifier(?, expression)
                                         listener: handleIdentifier(a, expression)
                                       listener: handleNoTypeArguments(})
@@ -2166,7 +2120,7 @@
                 ensureSemicolon(})
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test11, null, })
   listener: endTopLevelDeclaration(})
@@ -2242,7 +2196,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement({)
             parseStatementX({)
               parseReturnStatement({)
@@ -2262,7 +2216,6 @@
                                     parsePrimary((, expression, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                         parseSend((, expression, ConstantPatternContext.none)
-                                          isNextIdentifier(()
                                           ensureIdentifier((, expression)
                                             listener: handleIdentifier(t, expression)
                                           listener: handleNoTypeArguments())
@@ -2299,7 +2252,6 @@
                                   parsePrimary(in, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(in, expression, ConstantPatternContext.none)
                                       parseSend(in, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(in)
                                         ensureIdentifier(in, expression)
                                           listener: handleIdentifier(list, expression)
                                         listener: handleNoTypeArguments())
@@ -2323,7 +2275,6 @@
                                 parsePrimary(?, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(?, expression, ConstantPatternContext.none)
                                     parseSend(?, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(?)
                                       ensureIdentifier(?, expression)
                                         listener: handleIdentifier(a, expression)
                                       listener: handleNoTypeArguments(else)
@@ -2360,7 +2311,6 @@
                                   parsePrimary(in, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(in, expression, ConstantPatternContext.none)
                                       parseSend(in, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(in)
                                         ensureIdentifier(in, expression)
                                           listener: handleIdentifier(list, expression)
                                         listener: handleNoTypeArguments())
@@ -2384,7 +2334,6 @@
                                 parsePrimary(?, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(?, expression, ConstantPatternContext.none)
                                     parseSend(?, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(?)
                                       ensureIdentifier(?, expression)
                                         listener: handleIdentifier(b, expression)
                                       listener: handleNoTypeArguments(})
@@ -2398,7 +2347,7 @@
                 ensureSemicolon(})
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test12, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/null_aware_elements/simple_positive.dart.intertwined.expect b/pkg/front_end/parser_testcases/null_aware_elements/simple_positive.dart.intertwined.expect
index 6fbeb07..94d8c84 100644
--- a/pkg/front_end/parser_testcases/null_aware_elements/simple_positive.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/null_aware_elements/simple_positive.dart.intertwined.expect
@@ -55,7 +55,6 @@
                               parsePrimary(?, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(?, expression, ConstantPatternContext.none)
                                   parseSend(?, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(?)
                                     ensureIdentifier(?, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(])
@@ -122,7 +121,6 @@
                               parsePrimary(?, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(?, expression, ConstantPatternContext.none)
                                   parseSend(?, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(?)
                                     ensureIdentifier(?, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(})
@@ -204,7 +202,6 @@
                               parsePrimary(?, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(?, expression, ConstantPatternContext.none)
                                   parseSend(?, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(?)
                                     ensureIdentifier(?, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(:)
@@ -217,7 +214,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(y, expression)
                                     listener: handleNoTypeArguments(})
@@ -284,7 +280,6 @@
                               parsePrimary(?, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(?, expression, ConstantPatternContext.none)
                                   parseSend(?, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(?)
                                     ensureIdentifier(?, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(])
@@ -366,7 +361,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(b, expression)
                                         listener: handleNoTypeArguments())
@@ -382,7 +376,6 @@
                               parsePrimary(?, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(?, expression, ConstantPatternContext.none)
                                   parseSend(?, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(?)
                                     ensureIdentifier(?, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(})
@@ -484,7 +477,6 @@
                               parsePrimary(?, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(?, expression, ConstantPatternContext.none)
                                   parseSend(?, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(?)
                                     ensureIdentifier(?, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(})
@@ -567,7 +559,6 @@
                               parsePrimary({, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                                   parseSend({, expression, ConstantPatternContext.none)
-                                    isNextIdentifier({)
                                     ensureIdentifier({, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(:)
@@ -580,7 +571,6 @@
                               parsePrimary(?, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(?, expression, ConstantPatternContext.none)
                                   parseSend(?, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(?)
                                     ensureIdentifier(?, expression)
                                       listener: handleIdentifier(y, expression)
                                     listener: handleNoTypeArguments(})
@@ -662,7 +652,6 @@
                               parsePrimary(?, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(?, expression, ConstantPatternContext.none)
                                   parseSend(?, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(?)
                                     ensureIdentifier(?, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(:)
@@ -675,7 +664,6 @@
                               parsePrimary(:, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                   parseSend(:, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       listener: handleIdentifier(y, expression)
                                     listener: handleNoTypeArguments(})
@@ -757,7 +745,6 @@
                               parsePrimary(?, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(?, expression, ConstantPatternContext.none)
                                   parseSend(?, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(?)
                                     ensureIdentifier(?, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(:)
@@ -770,7 +757,6 @@
                               parsePrimary(?, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(?, expression, ConstantPatternContext.none)
                                   parseSend(?, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(?)
                                     ensureIdentifier(?, expression)
                                       listener: handleIdentifier(y, expression)
                                     listener: handleNoTypeArguments(})
@@ -867,7 +853,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(b, expression)
                                         listener: handleNoTypeArguments())
@@ -883,7 +868,6 @@
                               parsePrimary(?, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(?, expression, ConstantPatternContext.none)
                                   parseSend(?, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(?)
                                     ensureIdentifier(?, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(:)
@@ -896,7 +880,6 @@
                               parsePrimary(?, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(?, expression, ConstantPatternContext.none)
                                   parseSend(?, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(?)
                                     ensureIdentifier(?, expression)
                                       listener: handleIdentifier(y, expression)
                                     listener: handleNoTypeArguments(})
@@ -1013,7 +996,6 @@
                               parsePrimary(?, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(?, expression, ConstantPatternContext.none)
                                   parseSend(?, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(?)
                                     ensureIdentifier(?, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(:)
@@ -1026,7 +1008,6 @@
                               parsePrimary(?, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(?, expression, ConstantPatternContext.none)
                                   parseSend(?, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(?)
                                     ensureIdentifier(?, expression)
                                       listener: handleIdentifier(y, expression)
                                     listener: handleNoTypeArguments(})
diff --git a/pkg/front_end/parser_testcases/patterns/assignedVariable_namedAs.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/assignedVariable_namedAs.dart.intertwined.expect
index e19e73f..3f02c12 100644
--- a/pkg/front_end/parser_testcases/patterns/assignedVariable_namedAs.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/assignedVariable_namedAs.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, dynamic)
+          notEofOrType(CLOSE_CURLY_BRACKET, dynamic)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -58,7 +58,7 @@
                       listener: endInitializedIdentifier(as)
                     ensureSemicolon(as)
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -93,7 +93,6 @@
                               parsePrimary(=, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                   parseSend(=, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(=)
                                     ensureIdentifier(=, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(;)
@@ -103,7 +102,7 @@
                         listener: handlePatternAssignment(=)
                     ensureSemicolon(x)
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/assignedVariable_namedWhen.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/assignedVariable_namedWhen.dart.intertwined.expect
index f9b40fc..1d4082d 100644
--- a/pkg/front_end/parser_testcases/patterns/assignedVariable_namedWhen.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/assignedVariable_namedWhen.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, dynamic)
+          notEofOrType(CLOSE_CURLY_BRACKET, dynamic)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -58,7 +58,7 @@
                       listener: endInitializedIdentifier(when)
                     ensureSemicolon(when)
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -93,7 +93,6 @@
                               parsePrimary(=, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                   parseSend(=, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(=)
                                     ensureIdentifier(=, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(;)
@@ -103,7 +102,7 @@
                         listener: handlePatternAssignment(=)
                     ensureSemicolon(x)
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/boolean_literal_inside_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/boolean_literal_inside_case.dart.intertwined.expect
index 9c9868a0..bc82ea9 100644
--- a/pkg/front_end/parser_testcases/patterns/boolean_literal_inside_case.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/boolean_literal_inside_case.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -94,10 +93,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/boolean_literal_inside_cast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/boolean_literal_inside_cast.dart.intertwined.expect
index 43037b9..49375db 100644
--- a/pkg/front_end/parser_testcases/patterns/boolean_literal_inside_cast.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/boolean_literal_inside_cast.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -101,10 +100,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/boolean_literal_inside_if_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/boolean_literal_inside_if_case.dart.intertwined.expect
index f4e91ec..14b0b8b 100644
--- a/pkg/front_end/parser_testcases/patterns/boolean_literal_inside_if_case.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/boolean_literal_inside_if_case.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(case)
@@ -80,11 +79,11 @@
                     parseBlock(), BlockKind(statement))
                       ensureBlock(), BlockKind(statement))
                       listener: beginBlock({, BlockKind(statement))
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlock(0, {, }, BlockKind(statement))
                 listener: endThenStatement({, })
                 listener: endIfStatement(if, null, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/boolean_literal_inside_null_assert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/boolean_literal_inside_null_assert.dart.intertwined.expect
index 0a5abce..ba15a30 100644
--- a/pkg/front_end/parser_testcases/patterns/boolean_literal_inside_null_assert.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/boolean_literal_inside_null_assert.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -95,10 +94,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/boolean_literal_inside_null_check.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/boolean_literal_inside_null_check.dart.intertwined.expect
index c4ab646..b941573 100644
--- a/pkg/front_end/parser_testcases/patterns/boolean_literal_inside_null_check.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/boolean_literal_inside_null_check.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -95,10 +94,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/caseHead_withClassicPattern_guarded_insideIfStatement.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/caseHead_withClassicPattern_guarded_insideIfStatement.dart.intertwined.expect
index 67c366e..adb1d68 100644
--- a/pkg/front_end/parser_testcases/patterns/caseHead_withClassicPattern_guarded_insideIfStatement.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/caseHead_withClassicPattern_guarded_insideIfStatement.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(case)
@@ -87,11 +86,11 @@
                     parseBlock(), BlockKind(statement))
                       ensureBlock(), BlockKind(statement))
                       listener: beginBlock({, BlockKind(statement))
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlock(0, {, }, BlockKind(statement))
                 listener: endThenStatement({, })
                 listener: endIfStatement(if, null, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/caseHead_withClassicPattern_guarded_insideSwitchStatement.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/caseHead_withClassicPattern_guarded_insideSwitchStatement.dart.intertwined.expect
index 9e9e85b..0ac9feb 100644
--- a/pkg/front_end/parser_testcases/patterns/caseHead_withClassicPattern_guarded_insideSwitchStatement.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/caseHead_withClassicPattern_guarded_insideSwitchStatement.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -100,10 +99,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/caseHead_withClassicPattern_unguarded_insideIfStatement.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/caseHead_withClassicPattern_unguarded_insideIfStatement.dart.intertwined.expect
index 215cbcf..471b6ea 100644
--- a/pkg/front_end/parser_testcases/patterns/caseHead_withClassicPattern_unguarded_insideIfStatement.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/caseHead_withClassicPattern_unguarded_insideIfStatement.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(case)
@@ -77,11 +76,11 @@
                     parseBlock(), BlockKind(statement))
                       ensureBlock(), BlockKind(statement))
                       listener: beginBlock({, BlockKind(statement))
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlock(0, {, }, BlockKind(statement))
                 listener: endThenStatement({, })
                 listener: endIfStatement(if, null, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/caseHead_withClassicPattern_unguarded_insideSwitchStatement.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/caseHead_withClassicPattern_unguarded_insideSwitchStatement.dart.intertwined.expect
index a195e10..bba9759 100644
--- a/pkg/front_end/parser_testcases/patterns/caseHead_withClassicPattern_unguarded_insideSwitchStatement.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/caseHead_withClassicPattern_unguarded_insideSwitchStatement.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -91,10 +90,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/caseHead_withNewPattern_guarded_insideIfStatement.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/caseHead_withNewPattern_guarded_insideIfStatement.dart.intertwined.expect
index 679c598..6101b7e 100644
--- a/pkg/front_end/parser_testcases/patterns/caseHead_withNewPattern_guarded_insideIfStatement.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/caseHead_withNewPattern_guarded_insideIfStatement.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(case)
@@ -94,11 +93,11 @@
                     parseBlock(), BlockKind(statement))
                       ensureBlock(), BlockKind(statement))
                       listener: beginBlock({, BlockKind(statement))
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlock(0, {, }, BlockKind(statement))
                 listener: endThenStatement({, })
                 listener: endIfStatement(if, null, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/caseHead_withNewPattern_guarded_insideSwitchStatement.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/caseHead_withNewPattern_guarded_insideSwitchStatement.dart.intertwined.expect
index 4d963e4..15665d4 100644
--- a/pkg/front_end/parser_testcases/patterns/caseHead_withNewPattern_guarded_insideSwitchStatement.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/caseHead_withNewPattern_guarded_insideSwitchStatement.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -107,10 +106,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/caseHead_withNewPattern_unguarded_insideIfStatement.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/caseHead_withNewPattern_unguarded_insideIfStatement.dart.intertwined.expect
index 7bb7389..199248c 100644
--- a/pkg/front_end/parser_testcases/patterns/caseHead_withNewPattern_unguarded_insideIfStatement.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/caseHead_withNewPattern_unguarded_insideIfStatement.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(case)
@@ -84,11 +83,11 @@
                     parseBlock(), BlockKind(statement))
                       ensureBlock(), BlockKind(statement))
                       listener: beginBlock({, BlockKind(statement))
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlock(0, {, }, BlockKind(statement))
                 listener: endThenStatement({, })
                 listener: endIfStatement(if, null, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/caseHead_withNewPattern_unguarded_insideSwitchStatement.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/caseHead_withNewPattern_unguarded_insideSwitchStatement.dart.intertwined.expect
index d919ca6..e19a799 100644
--- a/pkg/front_end/parser_testcases/patterns/caseHead_withNewPattern_unguarded_insideSwitchStatement.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/caseHead_withNewPattern_unguarded_insideSwitchStatement.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -98,10 +97,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/case_identifier_dot_incomplete.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/case_identifier_dot_incomplete.dart.intertwined.expect
index da90687..cfe70fa 100644
--- a/pkg/front_end/parser_testcases/patterns/case_identifier_dot_incomplete.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/case_identifier_dot_incomplete.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -78,7 +77,6 @@
                           parsePrimary(case, expression, ConstantPatternContext.implicit)
                             parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.implicit)
                               parseSend(case, expression, ConstantPatternContext.implicit)
-                                isNextIdentifier(case)
                                 ensureIdentifier(case, expression)
                                   listener: handleIdentifier(A, expression)
                                 listener: handleNoTypeArguments(.)
@@ -88,7 +86,6 @@
                         parsePrimary(., expressionContinuation, ConstantPatternContext.implicit)
                           parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.implicit)
                             parseSend(., expressionContinuation, ConstantPatternContext.implicit)
-                              isNextIdentifier(.)
                               ensureIdentifier(., expressionContinuation)
                                 listener: handleIdentifier(, expressionContinuation)
                               listener: handleNoTypeArguments(})
@@ -109,10 +106,10 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/cast_insideCast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/cast_insideCast.dart.intertwined.expect
index e83b54d..33fb409 100644
--- a/pkg/front_end/parser_testcases/patterns/cast_insideCast.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/cast_insideCast.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, const)
+          notEofOrType(CLOSE_CURLY_BRACKET, const)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrConstDeclaration({)
@@ -64,7 +64,7 @@
                       listener: endInitializedIdentifier(y)
                     ensureSemicolon(1)
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement(;)
             parseStatementX(;)
               parseSwitchStatement(;)
@@ -80,7 +80,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -92,7 +91,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -104,7 +103,6 @@
                           parsePrimary(case, expression, ConstantPatternContext.implicit)
                             parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.implicit)
                               parseSend(case, expression, ConstantPatternContext.implicit)
-                                isNextIdentifier(case)
                                 ensureIdentifier(case, expression)
                                   listener: handleIdentifier(y, expression)
                                 listener: handleNoTypeArguments(as)
@@ -143,10 +141,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/cast_insideCast_parenthesized.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/cast_insideCast_parenthesized.dart.intertwined.expect
index 75fde8c..075caa9 100644
--- a/pkg/front_end/parser_testcases/patterns/cast_insideCast_parenthesized.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/cast_insideCast_parenthesized.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, const)
+          notEofOrType(CLOSE_CURLY_BRACKET, const)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrConstDeclaration({)
@@ -64,7 +64,7 @@
                       listener: endInitializedIdentifier(y)
                     ensureSemicolon(1)
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement(;)
             parseStatementX(;)
               parseSwitchStatement(;)
@@ -80,7 +80,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -92,7 +91,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -108,7 +107,6 @@
                                 parsePrimary((, expression, ConstantPatternContext.implicit)
                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.implicit)
                                     parseSend((, expression, ConstantPatternContext.implicit)
-                                      isNextIdentifier(()
                                       ensureIdentifier((, expression)
                                         listener: handleIdentifier(y, expression)
                                       listener: handleNoTypeArguments(as)
@@ -148,10 +146,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/cast_insideNullAssert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/cast_insideNullAssert.dart.intertwined.expect
index f83a5c3..e35a567 100644
--- a/pkg/front_end/parser_testcases/patterns/cast_insideNullAssert.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/cast_insideNullAssert.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, const)
+          notEofOrType(CLOSE_CURLY_BRACKET, const)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrConstDeclaration({)
@@ -64,7 +64,7 @@
                       listener: endInitializedIdentifier(y)
                     ensureSemicolon(1)
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement(;)
             parseStatementX(;)
               parseSwitchStatement(;)
@@ -80,7 +80,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -92,7 +91,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -104,7 +103,6 @@
                           parsePrimary(case, expression, ConstantPatternContext.implicit)
                             parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.implicit)
                               parseSend(case, expression, ConstantPatternContext.implicit)
-                                isNextIdentifier(case)
                                 ensureIdentifier(case, expression)
                                   listener: handleIdentifier(y, expression)
                                 listener: handleNoTypeArguments(as)
@@ -137,10 +135,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/cast_insideNullCheck.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/cast_insideNullCheck.dart.intertwined.expect
index 64d3af2..2866b0f 100644
--- a/pkg/front_end/parser_testcases/patterns/cast_insideNullCheck.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/cast_insideNullCheck.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, const)
+          notEofOrType(CLOSE_CURLY_BRACKET, const)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrConstDeclaration({)
@@ -64,7 +64,7 @@
                       listener: endInitializedIdentifier(y)
                     ensureSemicolon(1)
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement(;)
             parseStatementX(;)
               parseSwitchStatement(;)
@@ -80,7 +80,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -92,7 +91,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -104,7 +103,6 @@
                           parsePrimary(case, expression, ConstantPatternContext.implicit)
                             parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.implicit)
                               parseSend(case, expression, ConstantPatternContext.implicit)
-                                isNextIdentifier(case)
                                 ensureIdentifier(case, expression)
                                   listener: handleIdentifier(y, expression)
                                 listener: handleNoTypeArguments(as)
@@ -137,10 +135,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/cast_inside_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/cast_inside_case.dart.intertwined.expect
index b191544..5372d71 100644
--- a/pkg/front_end/parser_testcases/patterns/cast_inside_case.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/cast_inside_case.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, const)
+          notEofOrType(CLOSE_CURLY_BRACKET, const)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrConstDeclaration({)
@@ -67,7 +67,7 @@
                       listener: endInitializedIdentifier(y)
                     ensureSemicolon(1)
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement(;)
             parseStatementX(;)
               parseSwitchStatement(;)
@@ -83,7 +83,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -95,7 +94,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -107,7 +106,6 @@
                           parsePrimary(case, expression, ConstantPatternContext.implicit)
                             parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.implicit)
                               parseSend(case, expression, ConstantPatternContext.implicit)
-                                isNextIdentifier(case)
                                 ensureIdentifier(case, expression)
                                   listener: handleIdentifier(y, expression)
                                 listener: handleNoTypeArguments(as)
@@ -137,10 +135,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/cast_inside_extractor_pattern.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/cast_inside_extractor_pattern.dart.intertwined.expect
index 1160bee..9d2e79b 100644
--- a/pkg/front_end/parser_testcases/patterns/cast_inside_extractor_pattern.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/cast_inside_extractor_pattern.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(C, DeclarationKind.Class, C)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, C)
               parseMetadataStar({)
                 listener: beginMetadataStar(int)
@@ -42,7 +42,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -82,7 +82,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -98,7 +98,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -110,7 +109,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -156,10 +155,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/cast_inside_extractor_pattern_implicitly_named.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/cast_inside_extractor_pattern_implicitly_named.dart.intertwined.expect
index 60cc7f0..7d0b1af 100644
--- a/pkg/front_end/parser_testcases/patterns/cast_inside_extractor_pattern_implicitly_named.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/cast_inside_extractor_pattern_implicitly_named.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(C, DeclarationKind.Class, C)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, C)
               parseMetadataStar({)
                 listener: beginMetadataStar(int)
@@ -42,7 +42,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -82,7 +82,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -98,7 +98,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -110,7 +109,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -151,10 +150,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/cast_inside_if_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/cast_inside_if_case.dart.intertwined.expect
index 6eeec3f..6506517 100644
--- a/pkg/front_end/parser_testcases/patterns/cast_inside_if_case.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/cast_inside_if_case.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(case)
@@ -83,11 +82,11 @@
                     parseBlock(), BlockKind(statement))
                       ensureBlock(), BlockKind(statement))
                       listener: beginBlock({, BlockKind(statement))
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlock(0, {, }, BlockKind(statement))
                 listener: endThenStatement({, })
                 listener: endIfStatement(if, null, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/cast_inside_list_pattern.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/cast_inside_list_pattern.dart.intertwined.expect
index aea9529..9f3ab30 100644
--- a/pkg/front_end/parser_testcases/patterns/cast_inside_list_pattern.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/cast_inside_list_pattern.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -108,10 +107,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/cast_inside_logical_and_lhs.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/cast_inside_logical_and_lhs.dart.intertwined.expect
index 3caaaa6..b9d13c7 100644
--- a/pkg/front_end/parser_testcases/patterns/cast_inside_logical_and_lhs.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/cast_inside_logical_and_lhs.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -110,10 +109,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/cast_inside_logical_and_rhs.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/cast_inside_logical_and_rhs.dart.intertwined.expect
index f70d095..b0b6be4 100644
--- a/pkg/front_end/parser_testcases/patterns/cast_inside_logical_and_rhs.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/cast_inside_logical_and_rhs.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -110,10 +109,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/cast_inside_logical_or_lhs.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/cast_inside_logical_or_lhs.dart.intertwined.expect
index 51f5135..b0b57ca 100644
--- a/pkg/front_end/parser_testcases/patterns/cast_inside_logical_or_lhs.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/cast_inside_logical_or_lhs.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -110,10 +109,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/cast_inside_logical_or_rhs.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/cast_inside_logical_or_rhs.dart.intertwined.expect
index 2b9307a..cc5ca0e 100644
--- a/pkg/front_end/parser_testcases/patterns/cast_inside_logical_or_rhs.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/cast_inside_logical_or_rhs.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -110,10 +109,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/cast_inside_map_pattern.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/cast_inside_map_pattern.dart.intertwined.expect
index 25bc9ca..567deb7 100644
--- a/pkg/front_end/parser_testcases/patterns/cast_inside_map_pattern.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/cast_inside_map_pattern.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -119,10 +118,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/cast_inside_parenthesized_pattern.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/cast_inside_parenthesized_pattern.dart.intertwined.expect
index 7dd47c2..c23b618 100644
--- a/pkg/front_end/parser_testcases/patterns/cast_inside_parenthesized_pattern.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/cast_inside_parenthesized_pattern.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -108,10 +107,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/cast_inside_record_pattern_implicitly_named.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/cast_inside_record_pattern_implicitly_named.dart.intertwined.expect
index 1c56f38..7fc43f9 100644
--- a/pkg/front_end/parser_testcases/patterns/cast_inside_record_pattern_implicitly_named.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/cast_inside_record_pattern_implicitly_named.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -118,10 +117,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/cast_inside_record_pattern_named.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/cast_inside_record_pattern_named.dart.intertwined.expect
index 8fa72b9..b2c0354 100644
--- a/pkg/front_end/parser_testcases/patterns/cast_inside_record_pattern_named.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/cast_inside_record_pattern_named.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -123,10 +122,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/cast_inside_record_pattern_unnamed.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/cast_inside_record_pattern_unnamed.dart.intertwined.expect
index 0cc474b..a1afb74 100644
--- a/pkg/front_end/parser_testcases/patterns/cast_inside_record_pattern_unnamed.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/cast_inside_record_pattern_unnamed.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -121,10 +120,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/const_patterns.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/const_patterns.dart.intertwined.expect
index 0da519e..3a87c1b 100644
--- a/pkg/front_end/parser_testcases/patterns/const_patterns.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/const_patterns.dart.intertwined.expect
@@ -78,7 +78,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -105,7 +105,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Class, DeclarationKind.Class, Class)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, const)
+            notEofOrType(CLOSE_CURLY_BRACKET, const)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Class)
               parseMetadataStar({)
                 listener: beginMetadataStar(const)
@@ -150,7 +150,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, const, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, const)
+            notEofOrType(CLOSE_CURLY_BRACKET, const)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(const)
@@ -185,7 +185,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, const, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, call)
+            notEofOrType(CLOSE_CURLY_BRACKET, call)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(call)
@@ -213,11 +213,11 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(0, {, })
                 listener: endClassMethod(null, call, (, null, })
               listener: endMember()
-            notEofOrValue(}, test)
+            notEofOrType(CLOSE_CURLY_BRACKET, test)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Class)
               parseMetadataStar(})
                 listener: beginMetadataStar(test)
@@ -255,7 +255,7 @@
                 inPlainSync()
                 parseFunctionBody(async, false, false)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, const)
+                  notEofOrType(CLOSE_CURLY_BRACKET, const)
                   parseStatement({)
                     parseStatementX({)
                       parseExpressionStatementOrConstDeclaration({)
@@ -286,7 +286,7 @@
                               listener: endInitializedIdentifier(local)
                             ensureSemicolon(0)
                             listener: endVariablesDeclaration(1, ;)
-                  notEofOrValue(}, dynamic)
+                  notEofOrType(CLOSE_CURLY_BRACKET, dynamic)
                   parseStatement(;)
                     parseStatementX(;)
                       parseExpressionStatementOrDeclaration(;, null)
@@ -317,7 +317,7 @@
                               listener: endInitializedIdentifier(variable)
                             ensureSemicolon(0)
                             listener: endVariablesDeclaration(1, ;)
-                  notEofOrValue(}, switch)
+                  notEofOrType(CLOSE_CURLY_BRACKET, switch)
                   parseStatement(;)
                     parseStatementX(;)
                       parseSwitchStatement(;)
@@ -333,7 +333,6 @@
                                   parsePrimary((, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                       parseSend((, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(()
                                         ensureIdentifier((, expression)
                                           listener: handleIdentifier(o, expression)
                                         listener: handleNoTypeArguments())
@@ -345,7 +344,7 @@
                         parseSwitchBlock())
                           ensureBlock(), BlockKind(switch statement))
                           listener: beginSwitchBlock({)
-                          notEofOrValue(}, case)
+                          notEofOrType(CLOSE_CURLY_BRACKET, case)
                           peekPastLabels(case)
                           listener: beginCaseExpression(case)
                           parsePattern(case, PatternContext.matching, precedence: 1)
@@ -559,7 +558,6 @@
                                   parsePrimary(case, expression, ConstantPatternContext.implicit)
                                     parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.implicit)
                                       parseSend(case, expression, ConstantPatternContext.implicit)
-                                        isNextIdentifier(case)
                                         ensureIdentifier(case, expression)
                                           listener: handleIdentifier(value, expression)
                                         listener: handleNoTypeArguments(:)
@@ -582,7 +580,6 @@
                                   parsePrimary(case, expression, ConstantPatternContext.implicit)
                                     parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.implicit)
                                       parseSend(case, expression, ConstantPatternContext.implicit)
-                                        isNextIdentifier(case)
                                         ensureIdentifier(case, expression)
                                           listener: handleIdentifier(value, expression)
                                         listener: handleNoTypeArguments(!)
@@ -606,7 +603,6 @@
                                   parsePrimary(case, expression, ConstantPatternContext.implicit)
                                     parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.implicit)
                                       parseSend(case, expression, ConstantPatternContext.implicit)
-                                        isNextIdentifier(case)
                                         ensureIdentifier(case, expression)
                                           listener: handleIdentifier(value, expression)
                                         listener: handleNoTypeArguments(?)
@@ -630,7 +626,6 @@
                                   parsePrimary(case, expression, ConstantPatternContext.implicit)
                                     parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.implicit)
                                       parseSend(case, expression, ConstantPatternContext.implicit)
-                                        isNextIdentifier(case)
                                         ensureIdentifier(case, expression)
                                           listener: handleIdentifier(value, expression)
                                         listener: handleNoTypeArguments(as)
@@ -664,7 +659,6 @@
                                           listener: handleRecoverableError(InvalidConstantPatternNegation, value, value)
                                         parseSendOrFunctionLiteral(-, expression, ConstantPatternContext.numericLiteralOnly)
                                           parseSend(-, expression, ConstantPatternContext.numericLiteralOnly)
-                                            isNextIdentifier(-)
                                             ensureIdentifier(-, expression)
                                               listener: handleIdentifier(value, expression)
                                             listener: handleNoTypeArguments(:)
@@ -688,7 +682,6 @@
                                   parsePrimary(case, expression, ConstantPatternContext.implicit)
                                     parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.implicit)
                                       parseSend(case, expression, ConstantPatternContext.implicit)
-                                        isNextIdentifier(case)
                                         ensureIdentifier(case, expression)
                                           listener: handleIdentifier(local, expression)
                                         listener: handleNoTypeArguments(:)
@@ -715,7 +708,6 @@
                                           listener: handleRecoverableError(InvalidConstantPatternNegation, local, local)
                                         parseSendOrFunctionLiteral(-, expression, ConstantPatternContext.numericLiteralOnly)
                                           parseSend(-, expression, ConstantPatternContext.numericLiteralOnly)
-                                            isNextIdentifier(-)
                                             ensureIdentifier(-, expression)
                                               listener: handleIdentifier(local, expression)
                                             listener: handleNoTypeArguments(:)
@@ -739,7 +731,6 @@
                                   parsePrimary(case, expression, ConstantPatternContext.implicit)
                                     parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.implicit)
                                       parseSend(case, expression, ConstantPatternContext.implicit)
-                                        isNextIdentifier(case)
                                         ensureIdentifier(case, expression)
                                           listener: handleIdentifier(func, expression)
                                         listener: handleNoTypeArguments(:)
@@ -762,7 +753,6 @@
                                   parsePrimary(case, expression, ConstantPatternContext.implicit)
                                     parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.implicit)
                                       parseSend(case, expression, ConstantPatternContext.implicit)
-                                        isNextIdentifier(case)
                                         ensureIdentifier(case, expression)
                                           listener: handleIdentifier(prefix, expression)
                                         listener: handleNoTypeArguments(.)
@@ -772,7 +762,6 @@
                                 parsePrimary(., expressionContinuation, ConstantPatternContext.implicit)
                                   parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.implicit)
                                     parseSend(., expressionContinuation, ConstantPatternContext.implicit)
-                                      isNextIdentifier(.)
                                       ensureIdentifier(., expressionContinuation)
                                         listener: handleIdentifier(value, expressionContinuation)
                                       listener: handleNoTypeArguments(:)
@@ -800,7 +789,6 @@
                                           listener: handleRecoverableError(InvalidConstantPatternNegation, prefix, prefix)
                                         parseSendOrFunctionLiteral(-, expression, ConstantPatternContext.numericLiteralOnly)
                                           parseSend(-, expression, ConstantPatternContext.numericLiteralOnly)
-                                            isNextIdentifier(-)
                                             ensureIdentifier(-, expression)
                                               listener: handleIdentifier(prefix, expression)
                                             listener: handleNoTypeArguments(.)
@@ -812,7 +800,6 @@
                                         listener: handleRecoverableError(InvalidConstantPatternNegation, value, value)
                                       parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.numericLiteralOnly)
                                         parseSend(., expressionContinuation, ConstantPatternContext.numericLiteralOnly)
-                                          isNextIdentifier(.)
                                           ensureIdentifier(., expressionContinuation)
                                             listener: handleIdentifier(value, expressionContinuation)
                                           listener: handleNoTypeArguments(:)
@@ -837,7 +824,6 @@
                                   parsePrimary(case, expression, ConstantPatternContext.implicit)
                                     parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.implicit)
                                       parseSend(case, expression, ConstantPatternContext.implicit)
-                                        isNextIdentifier(case)
                                         ensureIdentifier(case, expression)
                                           listener: handleIdentifier(prefix, expression)
                                         listener: handleNoTypeArguments(.)
@@ -847,7 +833,6 @@
                                 parsePrimary(., expressionContinuation, ConstantPatternContext.implicit)
                                   parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.implicit)
                                     parseSend(., expressionContinuation, ConstantPatternContext.implicit)
-                                      isNextIdentifier(.)
                                       ensureIdentifier(., expressionContinuation)
                                         listener: handleIdentifier(Class, expressionContinuation)
                                       listener: handleNoTypeArguments(.)
@@ -858,7 +843,6 @@
                                 parsePrimary(., expressionContinuation, ConstantPatternContext.implicit)
                                   parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.implicit)
                                     parseSend(., expressionContinuation, ConstantPatternContext.implicit)
-                                      isNextIdentifier(.)
                                       ensureIdentifier(., expressionContinuation)
                                         listener: handleIdentifier(named, expressionContinuation)
                                       listener: handleNoTypeArguments(:)
@@ -966,7 +950,7 @@
                                                       inPlainSync()
                                                     parseFunctionBody(), true, false)
                                                       listener: beginBlockFunctionBody({)
-                                                      notEofOrValue(}, })
+                                                      notEofOrType(CLOSE_CURLY_BRACKET, })
                                                       listener: endBlockFunctionBody(0, {, })
                                                   listener: endFunctionExpression((, })
                                       ensureSemicolon(})
@@ -988,7 +972,6 @@
                                           parseUnaryExpression(;, true, ConstantPatternContext.none)
                                             parsePrimary(;, expression, ConstantPatternContext.none)
                                               parseSend(;, expression, ConstantPatternContext.none)
-                                                isNextIdentifier(;)
                                                 ensureIdentifier(;, expression)
                                                   reportRecoverableErrorWithToken(:, Template(ExpectedIdentifier))
                                                     listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got ':'., Try inserting an identifier before ':'., {lexeme: :}], :, :)
@@ -1007,7 +990,7 @@
                               listener: handleRecoverableError(Message[UnexpectedToken, Unexpected token ':'., null, {lexeme: :}], :, :)
                             peekPastLabels(case)
                             listener: endSwitchCase(0, 25, null, null, 2, case, :)
-                          notEofOrValue(}, case)
+                          notEofOrType(CLOSE_CURLY_BRACKET, case)
                           peekPastLabels(case)
                           listener: beginCaseExpression(case)
                           parsePattern(case, PatternContext.matching, precedence: 1)
@@ -1059,7 +1042,6 @@
                                                 parsePrimary((, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                     parseSend((, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(()
                                                       ensureIdentifier((, expression)
                                                         listener: handleIdentifier(o, expression)
                                                       listener: handleNoTypeArguments())
@@ -1174,7 +1156,6 @@
                                       parsePrimary(++, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral(++, expression, ConstantPatternContext.none)
                                           parseSend(++, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(++)
                                             ensureIdentifier(++, expression)
                                               listener: handleIdentifier(variable, expression)
                                             listener: handleNoTypeArguments(:)
@@ -1350,7 +1331,6 @@
                                   parsePrimary(const, expression, ConstantPatternContext.explicit)
                                     parseSendOrFunctionLiteral(const, expression, ConstantPatternContext.explicit)
                                       parseSend(const, expression, ConstantPatternContext.explicit)
-                                        isNextIdentifier(const)
                                         ensureIdentifier(const, expression)
                                           listener: handleIdentifier(value, expression)
                                         listener: handleNoTypeArguments(:)
@@ -1375,7 +1355,6 @@
                                   parsePrimary(const, expression, ConstantPatternContext.explicit)
                                     parseSendOrFunctionLiteral(const, expression, ConstantPatternContext.explicit)
                                       parseSend(const, expression, ConstantPatternContext.explicit)
-                                        isNextIdentifier(const)
                                         ensureIdentifier(const, expression)
                                           listener: handleIdentifier(local, expression)
                                         listener: handleNoTypeArguments(:)
@@ -1400,7 +1379,6 @@
                                   parsePrimary(const, expression, ConstantPatternContext.explicit)
                                     parseSendOrFunctionLiteral(const, expression, ConstantPatternContext.explicit)
                                       parseSend(const, expression, ConstantPatternContext.explicit)
-                                        isNextIdentifier(const)
                                         ensureIdentifier(const, expression)
                                           listener: handleIdentifier(prefix, expression)
                                         listener: handleNoTypeArguments(.)
@@ -1410,7 +1388,6 @@
                                 parsePrimary(., expressionContinuation, ConstantPatternContext.explicit)
                                   parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.explicit)
                                     parseSend(., expressionContinuation, ConstantPatternContext.explicit)
-                                      isNextIdentifier(.)
                                       ensureIdentifier(., expressionContinuation)
                                         listener: handleIdentifier(value, expressionContinuation)
                                       listener: handleNoTypeArguments(:)
@@ -1440,7 +1417,6 @@
                                       parsePrimary(-, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral(-, expression, ConstantPatternContext.none)
                                           parseSend(-, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(-)
                                             ensureIdentifier(-, expression)
                                               listener: handleIdentifier(prefix, expression)
                                             listener: handleNoTypeArguments(.)
@@ -1450,7 +1426,6 @@
                                     parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                         parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                          isNextIdentifier(.)
                                           ensureIdentifier(., expressionContinuation)
                                             listener: handleIdentifier(value, expressionContinuation)
                                           listener: handleNoTypeArguments(:)
@@ -1475,7 +1450,6 @@
                                   parsePrimary(const, expression, ConstantPatternContext.explicit)
                                     parseSendOrFunctionLiteral(const, expression, ConstantPatternContext.explicit)
                                       parseSend(const, expression, ConstantPatternContext.explicit)
-                                        isNextIdentifier(const)
                                         ensureIdentifier(const, expression)
                                           listener: handleIdentifier(prefix, expression)
                                         listener: handleNoTypeArguments(.)
@@ -1485,7 +1459,6 @@
                                 parsePrimary(., expressionContinuation, ConstantPatternContext.explicit)
                                   parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.explicit)
                                     parseSend(., expressionContinuation, ConstantPatternContext.explicit)
-                                      isNextIdentifier(.)
                                       ensureIdentifier(., expressionContinuation)
                                         listener: handleIdentifier(Class, expressionContinuation)
                                       listener: handleNoTypeArguments(.)
@@ -1496,7 +1469,6 @@
                                 parsePrimary(., expressionContinuation, ConstantPatternContext.explicit)
                                   parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.explicit)
                                     parseSend(., expressionContinuation, ConstantPatternContext.explicit)
-                                      isNextIdentifier(.)
                                       ensureIdentifier(., expressionContinuation)
                                         listener: handleIdentifier(named, expressionContinuation)
                                       listener: handleNoTypeArguments(:)
@@ -1572,7 +1544,7 @@
                                               inPlainSync()
                                             parseFunctionBody(), true, false)
                                               listener: beginBlockFunctionBody({)
-                                              notEofOrValue(}, })
+                                              notEofOrType(CLOSE_CURLY_BRACKET, })
                                               listener: endBlockFunctionBody(0, {, })
                                           listener: endNamedFunctionExpression(})
                               listener: endConstantPattern(const)
@@ -1631,7 +1603,6 @@
                                                 parsePrimary((, expression, ConstantPatternContext.none)
                                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                     parseSend((, expression, ConstantPatternContext.none)
-                                                      isNextIdentifier(()
                                                       ensureIdentifier((, expression)
                                                         listener: handleIdentifier(o, expression)
                                                       listener: handleNoTypeArguments())
@@ -1746,7 +1717,6 @@
                                       parsePrimary(++, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral(++, expression, ConstantPatternContext.none)
                                           parseSend(++, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(++)
                                             ensureIdentifier(++, expression)
                                               listener: handleIdentifier(variable, expression)
                                             listener: handleNoTypeArguments(:)
@@ -1771,7 +1741,6 @@
                                     parseSendOrFunctionLiteral(const, expression, ConstantPatternContext.explicit)
                                       looksLikeFunctionBody(:)
                                       parseSend(const, expression, ConstantPatternContext.explicit)
-                                        isNextIdentifier(const)
                                         ensureIdentifier(const, expression)
                                           listener: handleIdentifier(Class, expression)
                                         listener: handleNoTypeArguments(()
@@ -1798,7 +1767,6 @@
                                     parseSendOrFunctionLiteral(const, expression, ConstantPatternContext.explicit)
                                       looksLikeFunctionBody(:)
                                       parseSend(const, expression, ConstantPatternContext.explicit)
-                                        isNextIdentifier(const)
                                         ensureIdentifier(const, expression)
                                           listener: handleIdentifier(Class, expression)
                                         listener: handleNoTypeArguments(()
@@ -1833,7 +1801,6 @@
                                     parseSendOrFunctionLiteral(const, expression, ConstantPatternContext.explicit)
                                       looksLikeFunctionBody(:)
                                       parseSend(const, expression, ConstantPatternContext.explicit)
-                                        isNextIdentifier(const)
                                         ensureIdentifier(const, expression)
                                           listener: handleIdentifier(GenericClass, expression)
                                         listener: handleNoTypeArguments(()
@@ -1860,7 +1827,6 @@
                                     parseSendOrFunctionLiteral(const, expression, ConstantPatternContext.explicit)
                                       looksLikeFunctionBody(:)
                                       parseSend(const, expression, ConstantPatternContext.explicit)
-                                        isNextIdentifier(const)
                                         ensureIdentifier(const, expression)
                                           listener: handleIdentifier(GenericClass, expression)
                                         listener: handleNoTypeArguments(()
@@ -1898,7 +1864,6 @@
                                     parseSendOrFunctionLiteral(const, expression, ConstantPatternContext.explicit)
                                       looksLikeFunctionBody(:)
                                       parseSend(const, expression, ConstantPatternContext.explicit)
-                                        isNextIdentifier(const)
                                         ensureIdentifier(const, expression)
                                           listener: handleIdentifier(GenericClass, expression)
                                         listener: beginTypeArguments(<)
@@ -1929,7 +1894,6 @@
                                     parseSendOrFunctionLiteral(const, expression, ConstantPatternContext.explicit)
                                       looksLikeFunctionBody(:)
                                       parseSend(const, expression, ConstantPatternContext.explicit)
-                                        isNextIdentifier(const)
                                         ensureIdentifier(const, expression)
                                           listener: handleIdentifier(GenericClass, expression)
                                         listener: beginTypeArguments(<)
@@ -2468,7 +2432,6 @@
                                 parseUnaryExpression(const, false, ConstantPatternContext.explicit)
                                   parsePrimary(const, expression, ConstantPatternContext.explicit)
                                     parseNewExpression(const)
-                                      isNextIdentifier(new)
                                       listener: beginNewExpression(new)
                                       parseConstructorReference(new, ConstructorReferenceContext.New, null)
                                         ensureIdentifier(new, constructorReference)
@@ -2498,7 +2461,6 @@
                                 parseUnaryExpression(case, false, ConstantPatternContext.implicit)
                                   parsePrimary(case, expression, ConstantPatternContext.implicit)
                                     parseNewExpression(case)
-                                      isNextIdentifier(new)
                                       listener: beginNewExpression(new)
                                       parseConstructorReference(new, ConstructorReferenceContext.New, null)
                                         ensureIdentifier(new, constructorReference)
@@ -2640,7 +2602,6 @@
                                               parsePrimary((, expression, ConstantPatternContext.none)
                                                 parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                   parseSend((, expression, ConstantPatternContext.none)
-                                                    isNextIdentifier(()
                                                     ensureIdentifier((, expression)
                                                       listener: handleIdentifier(value, expression)
                                                     listener: handleNoTypeArguments())
@@ -2676,7 +2637,6 @@
                                                   parsePrimary(-, expression, ConstantPatternContext.none)
                                                     parseSendOrFunctionLiteral(-, expression, ConstantPatternContext.none)
                                                       parseSend(-, expression, ConstantPatternContext.none)
-                                                        isNextIdentifier(-)
                                                         ensureIdentifier(-, expression)
                                                           listener: handleIdentifier(value, expression)
                                                         listener: handleNoTypeArguments())
@@ -2736,7 +2696,6 @@
                                   parsePrimary(case, expression, ConstantPatternContext.implicit)
                                     parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.implicit)
                                       parseSend(case, expression, ConstantPatternContext.implicit)
-                                        isNextIdentifier(case)
                                         ensureIdentifier(case, expression)
                                           listener: handleIdentifier(GenericClass, expression)
                                         listener: handleNoTypeArguments(<)
@@ -2767,7 +2726,6 @@
                                   parsePrimary(case, expression, ConstantPatternContext.implicit)
                                     parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.implicit)
                                       parseSend(case, expression, ConstantPatternContext.implicit)
-                                        isNextIdentifier(case)
                                         ensureIdentifier(case, expression)
                                           listener: handleIdentifier(prefix, expression)
                                         listener: handleNoTypeArguments(.)
@@ -2777,7 +2735,6 @@
                                 parsePrimary(., expressionContinuation, ConstantPatternContext.implicit)
                                   parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.implicit)
                                     parseSend(., expressionContinuation, ConstantPatternContext.implicit)
-                                      isNextIdentifier(.)
                                       ensureIdentifier(., expressionContinuation)
                                         listener: handleIdentifier(GenericClass, expressionContinuation)
                                       listener: handleNoTypeArguments(<)
@@ -2809,7 +2766,6 @@
                                   parsePrimary(case, expression, ConstantPatternContext.implicit)
                                     parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.implicit)
                                       parseSend(case, expression, ConstantPatternContext.implicit)
-                                        isNextIdentifier(case)
                                         ensureIdentifier(case, expression)
                                           listener: handleIdentifier(GenericClass, expression)
                                         listener: handleNoTypeArguments(<)
@@ -2829,7 +2785,6 @@
                                   listener: handleNewAsIdentifier(new)
                                   parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.implicit)
                                     parseSend(., expressionContinuation, ConstantPatternContext.implicit)
-                                      isNextIdentifier(.)
                                       ensureIdentifier(., expressionContinuation)
                                         listener: handleIdentifier(new, expressionContinuation)
                                       listener: handleNoTypeArguments(:)
@@ -2853,7 +2808,6 @@
                                   parsePrimary(case, expression, ConstantPatternContext.implicit)
                                     parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.implicit)
                                       parseSend(case, expression, ConstantPatternContext.implicit)
-                                        isNextIdentifier(case)
                                         ensureIdentifier(case, expression)
                                           listener: handleIdentifier(prefix, expression)
                                         listener: handleNoTypeArguments(.)
@@ -2863,7 +2817,6 @@
                                 parsePrimary(., expressionContinuation, ConstantPatternContext.implicit)
                                   parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.implicit)
                                     parseSend(., expressionContinuation, ConstantPatternContext.implicit)
-                                      isNextIdentifier(.)
                                       ensureIdentifier(., expressionContinuation)
                                         listener: handleIdentifier(GenericClass, expressionContinuation)
                                       listener: handleNoTypeArguments(<)
@@ -2884,7 +2837,6 @@
                                   listener: handleNewAsIdentifier(new)
                                   parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.implicit)
                                     parseSend(., expressionContinuation, ConstantPatternContext.implicit)
-                                      isNextIdentifier(.)
                                       ensureIdentifier(., expressionContinuation)
                                         listener: handleIdentifier(new, expressionContinuation)
                                       listener: handleNoTypeArguments(:)
@@ -2908,7 +2860,6 @@
                                   parsePrimary(const, expression, ConstantPatternContext.explicit)
                                     parseSendOrFunctionLiteral(const, expression, ConstantPatternContext.explicit)
                                       parseSend(const, expression, ConstantPatternContext.explicit)
-                                        isNextIdentifier(const)
                                         ensureIdentifier(const, expression)
                                           listener: handleIdentifier(GenericClass, expression)
                                         listener: handleNoTypeArguments(<)
@@ -2939,7 +2890,6 @@
                                   parsePrimary(const, expression, ConstantPatternContext.explicit)
                                     parseSendOrFunctionLiteral(const, expression, ConstantPatternContext.explicit)
                                       parseSend(const, expression, ConstantPatternContext.explicit)
-                                        isNextIdentifier(const)
                                         ensureIdentifier(const, expression)
                                           listener: handleIdentifier(prefix, expression)
                                         listener: handleNoTypeArguments(.)
@@ -2949,7 +2899,6 @@
                                 parsePrimary(., expressionContinuation, ConstantPatternContext.explicit)
                                   parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.explicit)
                                     parseSend(., expressionContinuation, ConstantPatternContext.explicit)
-                                      isNextIdentifier(.)
                                       ensureIdentifier(., expressionContinuation)
                                         listener: handleIdentifier(GenericClass, expressionContinuation)
                                       listener: handleNoTypeArguments(<)
@@ -2991,7 +2940,6 @@
                                               parsePrimary((, expression, ConstantPatternContext.none)
                                                 parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                   parseSend((, expression, ConstantPatternContext.none)
-                                                    isNextIdentifier(()
                                                     ensureIdentifier((, expression)
                                                       listener: handleIdentifier(GenericClass, expression)
                                                     listener: handleNoTypeArguments(<)
@@ -3032,7 +2980,6 @@
                                               parsePrimary((, expression, ConstantPatternContext.none)
                                                 parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                   parseSend((, expression, ConstantPatternContext.none)
-                                                    isNextIdentifier(()
                                                     ensureIdentifier((, expression)
                                                       listener: handleIdentifier(prefix, expression)
                                                     listener: handleNoTypeArguments(.)
@@ -3042,7 +2989,6 @@
                                             parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                                               parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                                 parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                                  isNextIdentifier(.)
                                                   ensureIdentifier(., expressionContinuation)
                                                     listener: handleIdentifier(GenericClass, expressionContinuation)
                                                   listener: handleNoTypeArguments(<)
@@ -3084,7 +3030,6 @@
                                               parsePrimary((, expression, ConstantPatternContext.none)
                                                 parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                   parseSend((, expression, ConstantPatternContext.none)
-                                                    isNextIdentifier(()
                                                     ensureIdentifier((, expression)
                                                       listener: handleIdentifier(GenericClass, expression)
                                                     listener: handleNoTypeArguments(<)
@@ -3102,7 +3047,6 @@
                                               listener: handleNewAsIdentifier(new)
                                               parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                                 parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                                  isNextIdentifier(.)
                                                   ensureIdentifier(., expressionContinuation)
                                                     listener: handleIdentifier(new, expressionContinuation)
                                                   listener: handleNoTypeArguments())
@@ -3138,7 +3082,6 @@
                                               parsePrimary((, expression, ConstantPatternContext.none)
                                                 parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                   parseSend((, expression, ConstantPatternContext.none)
-                                                    isNextIdentifier(()
                                                     ensureIdentifier((, expression)
                                                       listener: handleIdentifier(prefix, expression)
                                                     listener: handleNoTypeArguments(.)
@@ -3148,7 +3091,6 @@
                                             parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                                               parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                                 parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                                  isNextIdentifier(.)
                                                   ensureIdentifier(., expressionContinuation)
                                                     listener: handleIdentifier(GenericClass, expressionContinuation)
                                                   listener: handleNoTypeArguments(<)
@@ -3167,7 +3109,6 @@
                                               listener: handleNewAsIdentifier(new)
                                               parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                                 parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                                  isNextIdentifier(.)
                                                   ensureIdentifier(., expressionContinuation)
                                                     listener: handleIdentifier(new, expressionContinuation)
                                                   listener: handleNoTypeArguments())
@@ -3200,7 +3141,6 @@
                                             parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                               looksLikeFunctionBody(;)
                                               parseSend(:, expression, ConstantPatternContext.none)
-                                                isNextIdentifier(:)
                                                 ensureIdentifier(:, expression)
                                                   listener: handleIdentifier(print, expression)
                                                 listener: handleNoTypeArguments(()
@@ -3222,14 +3162,14 @@
                                     listener: handleExpressionStatement(print, ;)
                             peekPastLabels(})
                             listener: endSwitchCase(0, 68, null, null, 1, case, ;)
-                          notEofOrValue(}, })
+                          notEofOrType(CLOSE_CURLY_BRACKET, })
                           listener: endSwitchBlock(2, {, })
                         listener: endSwitchStatement(switch, })
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(3, {, })
                 listener: endClassMethod(null, test, (, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 4, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -3264,7 +3204,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(>, DeclarationKind.Class, GenericClass)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, const)
+            notEofOrType(CLOSE_CURLY_BRACKET, const)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, GenericClass)
               parseMetadataStar({)
                 listener: beginMetadataStar(const)
@@ -3309,7 +3249,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, const, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/const_patterns_binary.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/const_patterns_binary.dart.intertwined.expect
index b2ae0ba..36c46bf 100644
--- a/pkg/front_end/parser_testcases/patterns/const_patterns_binary.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/const_patterns_binary.dart.intertwined.expect
@@ -76,7 +76,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Class, DeclarationKind.Class, Class)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Class)
               parseMetadataStar({)
                 listener: beginMetadataStar(static)
@@ -102,7 +102,7 @@
                   listener: endFieldInitializer(=, 2)
                 listener: endClassFields(null, null, null, static, null, null, const, 1, static, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -148,7 +148,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -164,7 +164,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(o, expression)
                                 listener: handleNoTypeArguments())
@@ -176,7 +175,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -270,7 +269,6 @@
                             parseSendOrFunctionLiteral(const, expression, ConstantPatternContext.explicit)
                               looksLikeFunctionBody(:)
                               parseSend(const, expression, ConstantPatternContext.explicit)
-                                isNextIdentifier(const)
                                 ensureIdentifier(const, expression)
                                   listener: handleIdentifier(Object, expression)
                                 listener: handleNoTypeArguments(()
@@ -778,7 +776,6 @@
                           parsePrimary(case, expression, ConstantPatternContext.implicit)
                             parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.implicit)
                               parseSend(case, expression, ConstantPatternContext.implicit)
-                                isNextIdentifier(case)
                                 ensureIdentifier(case, expression)
                                   listener: handleIdentifier(prefix, expression)
                                 listener: handleNoTypeArguments(.)
@@ -788,7 +785,6 @@
                         parsePrimary(., expressionContinuation, ConstantPatternContext.implicit)
                           parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.implicit)
                             parseSend(., expressionContinuation, ConstantPatternContext.implicit)
-                              isNextIdentifier(.)
                               ensureIdentifier(., expressionContinuation)
                                 listener: handleIdentifier(value, expressionContinuation)
                               listener: handleNoTypeArguments(as)
@@ -819,7 +815,6 @@
                           parsePrimary(case, expression, ConstantPatternContext.implicit)
                             parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.implicit)
                               parseSend(case, expression, ConstantPatternContext.implicit)
-                                isNextIdentifier(case)
                                 ensureIdentifier(case, expression)
                                   listener: handleIdentifier(prefix, expression)
                                 listener: handleNoTypeArguments(.)
@@ -829,7 +824,6 @@
                         parsePrimary(., expressionContinuation, ConstantPatternContext.implicit)
                           parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.implicit)
                             parseSend(., expressionContinuation, ConstantPatternContext.implicit)
-                              isNextIdentifier(.)
                               ensureIdentifier(., expressionContinuation)
                                 listener: handleIdentifier(Class, expressionContinuation)
                               listener: handleNoTypeArguments(.)
@@ -840,7 +834,6 @@
                         parsePrimary(., expressionContinuation, ConstantPatternContext.implicit)
                           parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.implicit)
                             parseSend(., expressionContinuation, ConstantPatternContext.implicit)
-                              isNextIdentifier(.)
                               ensureIdentifier(., expressionContinuation)
                                 listener: handleIdentifier(value, expressionContinuation)
                               listener: handleNoTypeArguments(as)
@@ -1417,7 +1410,6 @@
                             parseSendOrFunctionLiteral(const, expression, ConstantPatternContext.explicit)
                               looksLikeFunctionBody(==)
                               parseSend(const, expression, ConstantPatternContext.explicit)
-                                isNextIdentifier(const)
                                 ensureIdentifier(const, expression)
                                   listener: handleIdentifier(Object, expression)
                                 listener: handleNoTypeArguments(()
@@ -2166,7 +2158,6 @@
                                   parseUnaryExpression(:, true, ConstantPatternContext.none)
                                     parsePrimary(:, expression, ConstantPatternContext.none)
                                       parseSend(:, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(:)
                                         ensureIdentifier(:, expression)
                                           reportRecoverableErrorWithToken(??, Template(ExpectedIdentifier))
                                             listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got '??'., Try inserting an identifier before '??'., {lexeme: ??}], ??, ??)
@@ -2202,7 +2193,6 @@
                                   parseUnaryExpression(;, true, ConstantPatternContext.none)
                                     parsePrimary(;, expression, ConstantPatternContext.none)
                                       parseSend(;, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(;)
                                         ensureIdentifier(;, expression)
                                           reportRecoverableErrorWithToken(:, Template(ExpectedIdentifier))
                                             listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got ':'., Try inserting an identifier before ':'., {lexeme: :}], :, :)
@@ -2221,7 +2211,7 @@
                       listener: handleRecoverableError(Message[UnexpectedToken, Unexpected token ':'., null, {lexeme: :}], :, :)
                     peekPastLabels(case)
                     listener: endSwitchCase(0, 67, null, null, 2, case, :)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -2233,7 +2223,6 @@
                           parsePrimary(case, expression, ConstantPatternContext.implicit)
                             parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.implicit)
                               parseSend(case, expression, ConstantPatternContext.implicit)
-                                isNextIdentifier(case)
                                 ensureIdentifier(case, expression)
                                   listener: handleIdentifier(o, expression)
                                 listener: handleNoTypeArguments(++)
@@ -2257,7 +2246,6 @@
                           parsePrimary(case, expression, ConstantPatternContext.implicit)
                             parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.implicit)
                               parseSend(case, expression, ConstantPatternContext.implicit)
-                                isNextIdentifier(case)
                                 ensureIdentifier(case, expression)
                                   listener: handleIdentifier(o, expression)
                                 listener: handleNoTypeArguments(--)
@@ -2283,7 +2271,6 @@
                               parsePrimary(++, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(++, expression, ConstantPatternContext.none)
                                   parseSend(++, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(++)
                                     ensureIdentifier(++, expression)
                                       listener: handleIdentifier(o, expression)
                                     listener: handleNoTypeArguments(:)
@@ -2309,7 +2296,6 @@
                               parsePrimary(--, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(--, expression, ConstantPatternContext.none)
                                   parseSend(--, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(--)
                                     ensureIdentifier(--, expression)
                                       listener: handleIdentifier(o, expression)
                                     listener: handleNoTypeArguments(:)
@@ -2326,10 +2312,10 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 4, null, null)
                     listener: beginSwitchCase(0, 4, case)
                     listener: endSwitchCase(0, 4, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(2, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(method, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_identifier_doublyPrefixed_builtin.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_identifier_doublyPrefixed_builtin.dart.intertwined.expect
index 4ff8d4d..c626b05 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_identifier_doublyPrefixed_builtin.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_identifier_doublyPrefixed_builtin.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, const)
+          notEofOrType(CLOSE_CURLY_BRACKET, const)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrConstDeclaration({)
@@ -62,7 +62,6 @@
                                 inPlainSync()
                                 parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                   parseSend(=, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(=)
                                     ensureIdentifier(=, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(abstract, expression)
@@ -74,7 +73,6 @@
                               inPlainSync()
                               parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                 parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                  isNextIdentifier(.)
                                   ensureIdentifier(., expressionContinuation)
                                     inPlainSync()
                                     listener: handleIdentifier(as, expressionContinuation)
@@ -87,7 +85,6 @@
                               inPlainSync()
                               parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                 parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                  isNextIdentifier(.)
                                   ensureIdentifier(., expressionContinuation)
                                     inPlainSync()
                                     listener: handleIdentifier(get, expressionContinuation)
@@ -100,7 +97,7 @@
                       listener: endInitializedIdentifier(y)
                     ensureSemicolon(get)
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement(;)
             parseStatementX(;)
               parseSwitchStatement(;)
@@ -116,7 +113,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -128,7 +124,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -141,7 +137,6 @@
                             inPlainSync()
                             parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.implicit)
                               parseSend(case, expression, ConstantPatternContext.implicit)
-                                isNextIdentifier(case)
                                 ensureIdentifier(case, expression)
                                   inPlainSync()
                                   listener: handleIdentifier(abstract, expression)
@@ -153,7 +148,6 @@
                           inPlainSync()
                           parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.implicit)
                             parseSend(., expressionContinuation, ConstantPatternContext.implicit)
-                              isNextIdentifier(.)
                               ensureIdentifier(., expressionContinuation)
                                 inPlainSync()
                                 listener: handleIdentifier(as, expressionContinuation)
@@ -166,7 +160,6 @@
                           inPlainSync()
                           parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.implicit)
                             parseSend(., expressionContinuation, ConstantPatternContext.implicit)
-                              isNextIdentifier(.)
                               ensureIdentifier(., expressionContinuation)
                                 inPlainSync()
                                 listener: handleIdentifier(get, expressionContinuation)
@@ -191,10 +184,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_identifier_doublyPrefixed_insideCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_identifier_doublyPrefixed_insideCase.dart.intertwined.expect
index 99f8070..712e554 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_identifier_doublyPrefixed_insideCase.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_identifier_doublyPrefixed_insideCase.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -78,7 +77,6 @@
                           parsePrimary(case, expression, ConstantPatternContext.implicit)
                             parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.implicit)
                               parseSend(case, expression, ConstantPatternContext.implicit)
-                                isNextIdentifier(case)
                                 ensureIdentifier(case, expression)
                                   listener: handleIdentifier(a, expression)
                                 listener: handleNoTypeArguments(.)
@@ -88,7 +86,6 @@
                         parsePrimary(., expressionContinuation, ConstantPatternContext.implicit)
                           parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.implicit)
                             parseSend(., expressionContinuation, ConstantPatternContext.implicit)
-                              isNextIdentifier(.)
                               ensureIdentifier(., expressionContinuation)
                                 listener: handleIdentifier(b, expressionContinuation)
                               listener: handleNoTypeArguments(.)
@@ -99,7 +96,6 @@
                         parsePrimary(., expressionContinuation, ConstantPatternContext.implicit)
                           parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.implicit)
                             parseSend(., expressionContinuation, ConstantPatternContext.implicit)
-                              isNextIdentifier(.)
                               ensureIdentifier(., expressionContinuation)
                                 listener: handleIdentifier(c, expressionContinuation)
                               listener: handleNoTypeArguments(:)
@@ -123,10 +119,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_identifier_doublyPrefixed_insideCast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_identifier_doublyPrefixed_insideCast.dart.intertwined.expect
index 01d5f2d..dfc659d 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_identifier_doublyPrefixed_insideCast.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_identifier_doublyPrefixed_insideCast.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -78,7 +77,6 @@
                           parsePrimary(case, expression, ConstantPatternContext.implicit)
                             parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.implicit)
                               parseSend(case, expression, ConstantPatternContext.implicit)
-                                isNextIdentifier(case)
                                 ensureIdentifier(case, expression)
                                   listener: handleIdentifier(a, expression)
                                 listener: handleNoTypeArguments(.)
@@ -88,7 +86,6 @@
                         parsePrimary(., expressionContinuation, ConstantPatternContext.implicit)
                           parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.implicit)
                             parseSend(., expressionContinuation, ConstantPatternContext.implicit)
-                              isNextIdentifier(.)
                               ensureIdentifier(., expressionContinuation)
                                 listener: handleIdentifier(b, expressionContinuation)
                               listener: handleNoTypeArguments(.)
@@ -99,7 +96,6 @@
                         parsePrimary(., expressionContinuation, ConstantPatternContext.implicit)
                           parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.implicit)
                             parseSend(., expressionContinuation, ConstantPatternContext.implicit)
-                              isNextIdentifier(.)
                               ensureIdentifier(., expressionContinuation)
                                 listener: handleIdentifier(c, expressionContinuation)
                               listener: handleNoTypeArguments(as)
@@ -130,10 +126,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_identifier_doublyPrefixed_insideIfCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_identifier_doublyPrefixed_insideIfCase.dart.intertwined.expect
index 6992624..4107931 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_identifier_doublyPrefixed_insideIfCase.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_identifier_doublyPrefixed_insideIfCase.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(case)
@@ -70,7 +69,6 @@
                             parsePrimary(case, expression, ConstantPatternContext.implicit)
                               parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.implicit)
                                 parseSend(case, expression, ConstantPatternContext.implicit)
-                                  isNextIdentifier(case)
                                   ensureIdentifier(case, expression)
                                     listener: handleIdentifier(a, expression)
                                   listener: handleNoTypeArguments(.)
@@ -80,7 +78,6 @@
                           parsePrimary(., expressionContinuation, ConstantPatternContext.implicit)
                             parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.implicit)
                               parseSend(., expressionContinuation, ConstantPatternContext.implicit)
-                                isNextIdentifier(.)
                                 ensureIdentifier(., expressionContinuation)
                                   listener: handleIdentifier(b, expressionContinuation)
                                 listener: handleNoTypeArguments(.)
@@ -91,7 +88,6 @@
                           parsePrimary(., expressionContinuation, ConstantPatternContext.implicit)
                             parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.implicit)
                               parseSend(., expressionContinuation, ConstantPatternContext.implicit)
-                                isNextIdentifier(.)
                                 ensureIdentifier(., expressionContinuation)
                                   listener: handleIdentifier(c, expressionContinuation)
                                 listener: handleNoTypeArguments())
@@ -109,11 +105,11 @@
                     parseBlock(), BlockKind(statement))
                       ensureBlock(), BlockKind(statement))
                       listener: beginBlock({, BlockKind(statement))
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlock(0, {, }, BlockKind(statement))
                 listener: endThenStatement({, })
                 listener: endIfStatement(if, null, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_identifier_doublyPrefixed_insideNullAssert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_identifier_doublyPrefixed_insideNullAssert.dart.intertwined.expect
index c31b71f..8c5b103 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_identifier_doublyPrefixed_insideNullAssert.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_identifier_doublyPrefixed_insideNullAssert.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -78,7 +77,6 @@
                           parsePrimary(case, expression, ConstantPatternContext.implicit)
                             parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.implicit)
                               parseSend(case, expression, ConstantPatternContext.implicit)
-                                isNextIdentifier(case)
                                 ensureIdentifier(case, expression)
                                   listener: handleIdentifier(a, expression)
                                 listener: handleNoTypeArguments(.)
@@ -88,7 +86,6 @@
                         parsePrimary(., expressionContinuation, ConstantPatternContext.implicit)
                           parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.implicit)
                             parseSend(., expressionContinuation, ConstantPatternContext.implicit)
-                              isNextIdentifier(.)
                               ensureIdentifier(., expressionContinuation)
                                 listener: handleIdentifier(b, expressionContinuation)
                               listener: handleNoTypeArguments(.)
@@ -99,7 +96,6 @@
                         parsePrimary(., expressionContinuation, ConstantPatternContext.implicit)
                           parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.implicit)
                             parseSend(., expressionContinuation, ConstantPatternContext.implicit)
-                              isNextIdentifier(.)
                               ensureIdentifier(., expressionContinuation)
                                 listener: handleIdentifier(c, expressionContinuation)
                               listener: handleNoTypeArguments(!)
@@ -124,10 +120,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_identifier_doublyPrefixed_insideNullCheck.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_identifier_doublyPrefixed_insideNullCheck.dart.intertwined.expect
index 8183994..e507f6c 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_identifier_doublyPrefixed_insideNullCheck.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_identifier_doublyPrefixed_insideNullCheck.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -78,7 +77,6 @@
                           parsePrimary(case, expression, ConstantPatternContext.implicit)
                             parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.implicit)
                               parseSend(case, expression, ConstantPatternContext.implicit)
-                                isNextIdentifier(case)
                                 ensureIdentifier(case, expression)
                                   listener: handleIdentifier(a, expression)
                                 listener: handleNoTypeArguments(.)
@@ -88,7 +86,6 @@
                         parsePrimary(., expressionContinuation, ConstantPatternContext.implicit)
                           parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.implicit)
                             parseSend(., expressionContinuation, ConstantPatternContext.implicit)
-                              isNextIdentifier(.)
                               ensureIdentifier(., expressionContinuation)
                                 listener: handleIdentifier(b, expressionContinuation)
                               listener: handleNoTypeArguments(.)
@@ -99,7 +96,6 @@
                         parsePrimary(., expressionContinuation, ConstantPatternContext.implicit)
                           parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.implicit)
                             parseSend(., expressionContinuation, ConstantPatternContext.implicit)
-                              isNextIdentifier(.)
                               ensureIdentifier(., expressionContinuation)
                                 listener: handleIdentifier(c, expressionContinuation)
                               listener: handleNoTypeArguments(?)
@@ -124,10 +120,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_identifier_doublyPrefixed_pseudoKeyword.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_identifier_doublyPrefixed_pseudoKeyword.dart.intertwined.expect
index 077127c..a5cd006 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_identifier_doublyPrefixed_pseudoKeyword.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_identifier_doublyPrefixed_pseudoKeyword.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, const)
+          notEofOrType(CLOSE_CURLY_BRACKET, const)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrConstDeclaration({)
@@ -62,7 +62,6 @@
                                 inPlainSync()
                                 parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                   parseSend(=, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(=)
                                     ensureIdentifier(=, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(show, expression)
@@ -74,7 +73,6 @@
                               inPlainSync()
                               parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                 parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                  isNextIdentifier(.)
                                   ensureIdentifier(., expressionContinuation)
                                     inPlainSync()
                                     listener: handleIdentifier(hide, expressionContinuation)
@@ -87,7 +85,6 @@
                               inPlainSync()
                               parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                 parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                  isNextIdentifier(.)
                                   ensureIdentifier(., expressionContinuation)
                                     inPlainSync()
                                     listener: handleIdentifier(when, expressionContinuation)
@@ -100,7 +97,7 @@
                       listener: endInitializedIdentifier(y)
                     ensureSemicolon(when)
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement(;)
             parseStatementX(;)
               parseSwitchStatement(;)
@@ -116,7 +113,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -128,7 +124,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -141,7 +137,6 @@
                             inPlainSync()
                             parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.implicit)
                               parseSend(case, expression, ConstantPatternContext.implicit)
-                                isNextIdentifier(case)
                                 ensureIdentifier(case, expression)
                                   inPlainSync()
                                   listener: handleIdentifier(show, expression)
@@ -153,7 +148,6 @@
                           inPlainSync()
                           parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.implicit)
                             parseSend(., expressionContinuation, ConstantPatternContext.implicit)
-                              isNextIdentifier(.)
                               ensureIdentifier(., expressionContinuation)
                                 inPlainSync()
                                 listener: handleIdentifier(hide, expressionContinuation)
@@ -166,7 +160,6 @@
                           inPlainSync()
                           parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.implicit)
                             parseSend(., expressionContinuation, ConstantPatternContext.implicit)
-                              isNextIdentifier(.)
                               ensureIdentifier(., expressionContinuation)
                                 inPlainSync()
                                 listener: handleIdentifier(when, expressionContinuation)
@@ -191,10 +184,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_identifier_inside_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_identifier_inside_case.dart.intertwined.expect
index 941ed5b..0b82f5d 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_identifier_inside_case.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_identifier_inside_case.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, const)
+          notEofOrType(CLOSE_CURLY_BRACKET, const)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrConstDeclaration({)
@@ -67,7 +67,7 @@
                       listener: endInitializedIdentifier(y)
                     ensureSemicolon(1)
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement(;)
             parseStatementX(;)
               parseSwitchStatement(;)
@@ -83,7 +83,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -95,7 +94,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -107,7 +106,6 @@
                           parsePrimary(case, expression, ConstantPatternContext.implicit)
                             parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.implicit)
                               parseSend(case, expression, ConstantPatternContext.implicit)
-                                isNextIdentifier(case)
                                 ensureIdentifier(case, expression)
                                   listener: handleIdentifier(y, expression)
                                 listener: handleNoTypeArguments(:)
@@ -130,10 +128,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_identifier_inside_cast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_identifier_inside_cast.dart.intertwined.expect
index 86e3355..d41dd0b 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_identifier_inside_cast.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_identifier_inside_cast.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, const)
+          notEofOrType(CLOSE_CURLY_BRACKET, const)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrConstDeclaration({)
@@ -67,7 +67,7 @@
                       listener: endInitializedIdentifier(y)
                     ensureSemicolon(1)
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement(;)
             parseStatementX(;)
               parseSwitchStatement(;)
@@ -83,7 +83,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -95,7 +94,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -107,7 +106,6 @@
                           parsePrimary(case, expression, ConstantPatternContext.implicit)
                             parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.implicit)
                               parseSend(case, expression, ConstantPatternContext.implicit)
-                                isNextIdentifier(case)
                                 ensureIdentifier(case, expression)
                                   listener: handleIdentifier(y, expression)
                                 listener: handleNoTypeArguments(as)
@@ -137,10 +135,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_identifier_inside_if_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_identifier_inside_if_case.dart.intertwined.expect
index af42055..dcfcddc 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_identifier_inside_if_case.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_identifier_inside_if_case.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, const)
+          notEofOrType(CLOSE_CURLY_BRACKET, const)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrConstDeclaration({)
@@ -67,7 +67,7 @@
                       listener: endInitializedIdentifier(y)
                     ensureSemicolon(1)
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement(;)
             parseStatementX(;)
               parseIfStatement(;)
@@ -83,7 +83,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(case)
@@ -99,7 +98,6 @@
                             parsePrimary(case, expression, ConstantPatternContext.implicit)
                               parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.implicit)
                                 parseSend(case, expression, ConstantPatternContext.implicit)
-                                  isNextIdentifier(case)
                                   ensureIdentifier(case, expression)
                                     listener: handleIdentifier(y, expression)
                                   listener: handleNoTypeArguments())
@@ -116,11 +114,11 @@
                     parseBlock(), BlockKind(statement))
                       ensureBlock(), BlockKind(statement))
                       listener: beginBlock({, BlockKind(statement))
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlock(0, {, }, BlockKind(statement))
                 listener: endThenStatement({, })
                 listener: endIfStatement(if, null, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_identifier_inside_null_assert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_identifier_inside_null_assert.dart.intertwined.expect
index 5700ca39..e277279 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_identifier_inside_null_assert.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_identifier_inside_null_assert.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, const)
+          notEofOrType(CLOSE_CURLY_BRACKET, const)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrConstDeclaration({)
@@ -67,7 +67,7 @@
                       listener: endInitializedIdentifier(y)
                     ensureSemicolon(1)
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement(;)
             parseStatementX(;)
               parseSwitchStatement(;)
@@ -83,7 +83,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -95,7 +94,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -107,7 +106,6 @@
                           parsePrimary(case, expression, ConstantPatternContext.implicit)
                             parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.implicit)
                               parseSend(case, expression, ConstantPatternContext.implicit)
-                                isNextIdentifier(case)
                                 ensureIdentifier(case, expression)
                                   listener: handleIdentifier(y, expression)
                                 listener: handleNoTypeArguments(!)
@@ -131,10 +129,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_identifier_inside_null_check.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_identifier_inside_null_check.dart.intertwined.expect
index 1b762b2..2db5efa 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_identifier_inside_null_check.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_identifier_inside_null_check.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, const)
+          notEofOrType(CLOSE_CURLY_BRACKET, const)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrConstDeclaration({)
@@ -67,7 +67,7 @@
                       listener: endInitializedIdentifier(y)
                     ensureSemicolon(1)
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement(;)
             parseStatementX(;)
               parseSwitchStatement(;)
@@ -83,7 +83,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -95,7 +94,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -107,7 +106,6 @@
                           parsePrimary(case, expression, ConstantPatternContext.implicit)
                             parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.implicit)
                               parseSend(case, expression, ConstantPatternContext.implicit)
-                                isNextIdentifier(case)
                                 ensureIdentifier(case, expression)
                                   listener: handleIdentifier(y, expression)
                                 listener: handleNoTypeArguments(?)
@@ -131,10 +129,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_identifier_namedAs.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_identifier_namedAs.dart.intertwined.expect
index 50320b0..767f779 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_identifier_namedAs.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_identifier_namedAs.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -78,7 +77,6 @@
                             inPlainSync()
                             parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.implicit)
                               parseSend(case, expression, ConstantPatternContext.implicit)
-                                isNextIdentifier(case)
                                 ensureIdentifier(case, expression)
                                   inPlainSync()
                                   listener: handleIdentifier(as, expression)
@@ -95,10 +93,10 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_identifier_namedWhen.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_identifier_namedWhen.dart.intertwined.expect
index ff95dd7..cc8570f 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_identifier_namedWhen.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_identifier_namedWhen.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -78,7 +77,6 @@
                             inPlainSync()
                             parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.implicit)
                               parseSend(case, expression, ConstantPatternContext.implicit)
-                                isNextIdentifier(case)
                                 ensureIdentifier(case, expression)
                                   inPlainSync()
                                   listener: handleIdentifier(when, expression)
@@ -95,10 +93,10 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixedWithUnderscore_insideCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixedWithUnderscore_insideCase.dart.intertwined.expect
index 8387619..52f0d2d 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixedWithUnderscore_insideCase.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixedWithUnderscore_insideCase.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -75,7 +74,6 @@
                           parsePrimary(case, expression, ConstantPatternContext.implicit)
                             parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.implicit)
                               parseSend(case, expression, ConstantPatternContext.implicit)
-                                isNextIdentifier(case)
                                 ensureIdentifier(case, expression)
                                   listener: handleIdentifier(_, expression)
                                 listener: handleNoTypeArguments(.)
@@ -85,7 +83,6 @@
                         parsePrimary(., expressionContinuation, ConstantPatternContext.implicit)
                           parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.implicit)
                             parseSend(., expressionContinuation, ConstantPatternContext.implicit)
-                              isNextIdentifier(.)
                               ensureIdentifier(., expressionContinuation)
                                 listener: handleIdentifier(b, expressionContinuation)
                               listener: handleNoTypeArguments(:)
@@ -109,10 +106,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixed_builtin.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixed_builtin.dart.intertwined.expect
index 7e49ee5..0823692 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixed_builtin.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixed_builtin.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, const)
+          notEofOrType(CLOSE_CURLY_BRACKET, const)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrConstDeclaration({)
@@ -62,7 +62,6 @@
                                 inPlainSync()
                                 parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                   parseSend(=, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(=)
                                     ensureIdentifier(=, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(abstract, expression)
@@ -74,7 +73,6 @@
                               inPlainSync()
                               parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                 parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                  isNextIdentifier(.)
                                   ensureIdentifier(., expressionContinuation)
                                     inPlainSync()
                                     listener: handleIdentifier(as, expressionContinuation)
@@ -87,7 +85,7 @@
                       listener: endInitializedIdentifier(y)
                     ensureSemicolon(as)
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement(;)
             parseStatementX(;)
               parseSwitchStatement(;)
@@ -103,7 +101,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -115,7 +112,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -128,7 +125,6 @@
                             inPlainSync()
                             parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.implicit)
                               parseSend(case, expression, ConstantPatternContext.implicit)
-                                isNextIdentifier(case)
                                 ensureIdentifier(case, expression)
                                   inPlainSync()
                                   listener: handleIdentifier(abstract, expression)
@@ -140,7 +136,6 @@
                           inPlainSync()
                           parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.implicit)
                             parseSend(., expressionContinuation, ConstantPatternContext.implicit)
-                              isNextIdentifier(.)
                               ensureIdentifier(., expressionContinuation)
                                 inPlainSync()
                                 listener: handleIdentifier(as, expressionContinuation)
@@ -165,10 +160,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixed_insideCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixed_insideCase.dart.intertwined.expect
index ae69501..df0f88d 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixed_insideCase.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixed_insideCase.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -78,7 +77,6 @@
                           parsePrimary(case, expression, ConstantPatternContext.implicit)
                             parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.implicit)
                               parseSend(case, expression, ConstantPatternContext.implicit)
-                                isNextIdentifier(case)
                                 ensureIdentifier(case, expression)
                                   listener: handleIdentifier(a, expression)
                                 listener: handleNoTypeArguments(.)
@@ -88,7 +86,6 @@
                         parsePrimary(., expressionContinuation, ConstantPatternContext.implicit)
                           parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.implicit)
                             parseSend(., expressionContinuation, ConstantPatternContext.implicit)
-                              isNextIdentifier(.)
                               ensureIdentifier(., expressionContinuation)
                                 listener: handleIdentifier(b, expressionContinuation)
                               listener: handleNoTypeArguments(:)
@@ -112,10 +109,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixed_insideCast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixed_insideCast.dart.intertwined.expect
index 2a2017f..af6efc4 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixed_insideCast.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixed_insideCast.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -78,7 +77,6 @@
                           parsePrimary(case, expression, ConstantPatternContext.implicit)
                             parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.implicit)
                               parseSend(case, expression, ConstantPatternContext.implicit)
-                                isNextIdentifier(case)
                                 ensureIdentifier(case, expression)
                                   listener: handleIdentifier(a, expression)
                                 listener: handleNoTypeArguments(.)
@@ -88,7 +86,6 @@
                         parsePrimary(., expressionContinuation, ConstantPatternContext.implicit)
                           parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.implicit)
                             parseSend(., expressionContinuation, ConstantPatternContext.implicit)
-                              isNextIdentifier(.)
                               ensureIdentifier(., expressionContinuation)
                                 listener: handleIdentifier(b, expressionContinuation)
                               listener: handleNoTypeArguments(as)
@@ -119,10 +116,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixed_insideIfCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixed_insideIfCase.dart.intertwined.expect
index 1935388..9482ab4 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixed_insideIfCase.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixed_insideIfCase.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(case)
@@ -70,7 +69,6 @@
                             parsePrimary(case, expression, ConstantPatternContext.implicit)
                               parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.implicit)
                                 parseSend(case, expression, ConstantPatternContext.implicit)
-                                  isNextIdentifier(case)
                                   ensureIdentifier(case, expression)
                                     listener: handleIdentifier(a, expression)
                                   listener: handleNoTypeArguments(.)
@@ -80,7 +78,6 @@
                           parsePrimary(., expressionContinuation, ConstantPatternContext.implicit)
                             parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.implicit)
                               parseSend(., expressionContinuation, ConstantPatternContext.implicit)
-                                isNextIdentifier(.)
                                 ensureIdentifier(., expressionContinuation)
                                   listener: handleIdentifier(b, expressionContinuation)
                                 listener: handleNoTypeArguments())
@@ -98,11 +95,11 @@
                     parseBlock(), BlockKind(statement))
                       ensureBlock(), BlockKind(statement))
                       listener: beginBlock({, BlockKind(statement))
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlock(0, {, }, BlockKind(statement))
                 listener: endThenStatement({, })
                 listener: endIfStatement(if, null, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixed_insideNullAssert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixed_insideNullAssert.dart.intertwined.expect
index 6d5cb5c..3f50d90 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixed_insideNullAssert.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixed_insideNullAssert.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -78,7 +77,6 @@
                           parsePrimary(case, expression, ConstantPatternContext.implicit)
                             parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.implicit)
                               parseSend(case, expression, ConstantPatternContext.implicit)
-                                isNextIdentifier(case)
                                 ensureIdentifier(case, expression)
                                   listener: handleIdentifier(a, expression)
                                 listener: handleNoTypeArguments(.)
@@ -88,7 +86,6 @@
                         parsePrimary(., expressionContinuation, ConstantPatternContext.implicit)
                           parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.implicit)
                             parseSend(., expressionContinuation, ConstantPatternContext.implicit)
-                              isNextIdentifier(.)
                               ensureIdentifier(., expressionContinuation)
                                 listener: handleIdentifier(b, expressionContinuation)
                               listener: handleNoTypeArguments(!)
@@ -113,10 +110,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixed_insideNullCheck.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixed_insideNullCheck.dart.intertwined.expect
index 9f6b16b..82fb519 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixed_insideNullCheck.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixed_insideNullCheck.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -78,7 +77,6 @@
                           parsePrimary(case, expression, ConstantPatternContext.implicit)
                             parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.implicit)
                               parseSend(case, expression, ConstantPatternContext.implicit)
-                                isNextIdentifier(case)
                                 ensureIdentifier(case, expression)
                                   listener: handleIdentifier(a, expression)
                                 listener: handleNoTypeArguments(.)
@@ -88,7 +86,6 @@
                         parsePrimary(., expressionContinuation, ConstantPatternContext.implicit)
                           parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.implicit)
                             parseSend(., expressionContinuation, ConstantPatternContext.implicit)
-                              isNextIdentifier(.)
                               ensureIdentifier(., expressionContinuation)
                                 listener: handleIdentifier(b, expressionContinuation)
                               listener: handleNoTypeArguments(?)
@@ -113,10 +110,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixed_pseudoKeyword.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixed_pseudoKeyword.dart.intertwined.expect
index e4cd682..945a792 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixed_pseudoKeyword.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixed_pseudoKeyword.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, const)
+          notEofOrType(CLOSE_CURLY_BRACKET, const)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrConstDeclaration({)
@@ -62,7 +62,6 @@
                                 inPlainSync()
                                 parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                   parseSend(=, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(=)
                                     ensureIdentifier(=, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(show, expression)
@@ -74,7 +73,6 @@
                               inPlainSync()
                               parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                 parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                  isNextIdentifier(.)
                                   ensureIdentifier(., expressionContinuation)
                                     inPlainSync()
                                     listener: handleIdentifier(hide, expressionContinuation)
@@ -87,7 +85,7 @@
                       listener: endInitializedIdentifier(y)
                     ensureSemicolon(hide)
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement(;)
             parseStatementX(;)
               parseSwitchStatement(;)
@@ -103,7 +101,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -115,7 +112,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -128,7 +125,6 @@
                             inPlainSync()
                             parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.implicit)
                               parseSend(case, expression, ConstantPatternContext.implicit)
-                                isNextIdentifier(case)
                                 ensureIdentifier(case, expression)
                                   inPlainSync()
                                   listener: handleIdentifier(show, expression)
@@ -140,7 +136,6 @@
                           inPlainSync()
                           parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.implicit)
                             parseSend(., expressionContinuation, ConstantPatternContext.implicit)
-                              isNextIdentifier(.)
                               ensureIdentifier(., expressionContinuation)
                                 inPlainSync()
                                 listener: handleIdentifier(hide, expressionContinuation)
@@ -165,10 +160,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_identifier_unprefixed_beforeWhen.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_identifier_unprefixed_beforeWhen.dart.intertwined.expect
index d31fc31..88734b9 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_identifier_unprefixed_beforeWhen.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_identifier_unprefixed_beforeWhen.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, const)
+          notEofOrType(CLOSE_CURLY_BRACKET, const)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrConstDeclaration({)
@@ -64,7 +64,7 @@
                       listener: endInitializedIdentifier(y)
                     ensureSemicolon(1)
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement(;)
             parseStatementX(;)
               parseSwitchStatement(;)
@@ -80,7 +80,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -92,7 +91,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -104,7 +103,6 @@
                           parsePrimary(case, expression, ConstantPatternContext.implicit)
                             parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.implicit)
                               parseSend(case, expression, ConstantPatternContext.implicit)
-                                isNextIdentifier(case)
                                 ensureIdentifier(case, expression)
                                   listener: handleIdentifier(y, expression)
                                 listener: handleNoTypeArguments(when)
@@ -136,10 +134,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_identifier_unprefixed_builtin.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_identifier_unprefixed_builtin.dart.intertwined.expect
index b2394f8..f510638 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_identifier_unprefixed_builtin.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_identifier_unprefixed_builtin.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, const)
+          notEofOrType(CLOSE_CURLY_BRACKET, const)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrConstDeclaration({)
@@ -62,7 +62,6 @@
                                 inPlainSync()
                                 parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                   parseSend(=, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(=)
                                     ensureIdentifier(=, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(abstract, expression)
@@ -74,7 +73,7 @@
                       listener: endInitializedIdentifier(y)
                     ensureSemicolon(abstract)
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement(;)
             parseStatementX(;)
               parseSwitchStatement(;)
@@ -90,7 +89,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -102,7 +100,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -115,7 +113,6 @@
                             inPlainSync()
                             parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.implicit)
                               parseSend(case, expression, ConstantPatternContext.implicit)
-                                isNextIdentifier(case)
                                 ensureIdentifier(case, expression)
                                   inPlainSync()
                                   listener: handleIdentifier(abstract, expression)
@@ -139,10 +136,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_identifier_unprefixed_insideSwitchExpression.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_identifier_unprefixed_insideSwitchExpression.dart.intertwined.expect
index afb2593..4211838 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_identifier_unprefixed_insideSwitchExpression.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_identifier_unprefixed_insideSwitchExpression.dart.intertwined.expect
@@ -56,7 +56,6 @@
                                 parsePrimary((, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                     parseSend((, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(()
                                       ensureIdentifier((, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments())
@@ -77,7 +76,6 @@
                               parsePrimary({, expression, ConstantPatternContext.implicit)
                                 parseSendOrFunctionLiteral({, expression, ConstantPatternContext.implicit)
                                   parseSend({, expression, ConstantPatternContext.implicit)
-                                    isNextIdentifier({)
                                     ensureIdentifier({, expression)
                                       listener: handleIdentifier(y, expression)
                                     listener: handleNoTypeArguments(=>)
diff --git a/pkg/front_end/parser_testcases/patterns/constant_identifier_unprefixed_pseudoKeyword.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_identifier_unprefixed_pseudoKeyword.dart.intertwined.expect
index 57ba9ff..efde397 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_identifier_unprefixed_pseudoKeyword.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_identifier_unprefixed_pseudoKeyword.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, const)
+          notEofOrType(CLOSE_CURLY_BRACKET, const)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrConstDeclaration({)
@@ -62,7 +62,6 @@
                                 inPlainSync()
                                 parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                   parseSend(=, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(=)
                                     ensureIdentifier(=, expression)
                                       inPlainSync()
                                       listener: handleIdentifier(show, expression)
@@ -74,7 +73,7 @@
                       listener: endInitializedIdentifier(y)
                     ensureSemicolon(show)
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement(;)
             parseStatementX(;)
               parseSwitchStatement(;)
@@ -90,7 +89,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -102,7 +100,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -115,7 +113,6 @@
                             inPlainSync()
                             parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.implicit)
                               parseSend(case, expression, ConstantPatternContext.implicit)
-                                isNextIdentifier(case)
                                 ensureIdentifier(case, expression)
                                   inPlainSync()
                                   listener: handleIdentifier(show, expression)
@@ -139,10 +136,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_list_typed_empty_insideCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_list_typed_empty_insideCase.dart.intertwined.expect
index 53c8aa7..3b9cf31 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_list_typed_empty_insideCase.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_list_typed_empty_insideCase.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -103,10 +102,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_list_typed_empty_insideCast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_list_typed_empty_insideCast.dart.intertwined.expect
index 37cf35b..530e656 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_list_typed_empty_insideCast.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_list_typed_empty_insideCast.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -110,10 +109,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_list_typed_empty_insideIfCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_list_typed_empty_insideIfCase.dart.intertwined.expect
index dcc10d4..6b9971b 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_list_typed_empty_insideIfCase.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_list_typed_empty_insideIfCase.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(case)
@@ -89,11 +88,11 @@
                     parseBlock(), BlockKind(statement))
                       ensureBlock(), BlockKind(statement))
                       listener: beginBlock({, BlockKind(statement))
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlock(0, {, }, BlockKind(statement))
                 listener: endThenStatement({, })
                 listener: endIfStatement(if, null, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_list_typed_empty_insideNullAssert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_list_typed_empty_insideNullAssert.dart.intertwined.expect
index bc339f1..7d52b88 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_list_typed_empty_insideNullAssert.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_list_typed_empty_insideNullAssert.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -104,10 +103,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_list_typed_empty_insideNullCheck.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_list_typed_empty_insideNullCheck.dart.intertwined.expect
index b35f622..271fbd2 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_list_typed_empty_insideNullCheck.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_list_typed_empty_insideNullCheck.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -104,10 +103,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_list_typed_nonEmpty_insideCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_list_typed_nonEmpty_insideCase.dart.intertwined.expect
index 996d4e9..093fc01 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_list_typed_nonEmpty_insideCase.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_list_typed_nonEmpty_insideCase.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -108,10 +107,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_list_typed_nonEmpty_insideCast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_list_typed_nonEmpty_insideCast.dart.intertwined.expect
index b94d334..200931f 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_list_typed_nonEmpty_insideCast.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_list_typed_nonEmpty_insideCast.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -115,10 +114,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_list_typed_nonEmpty_insideIfCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_list_typed_nonEmpty_insideIfCase.dart.intertwined.expect
index 7a697ac..019285b 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_list_typed_nonEmpty_insideIfCase.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_list_typed_nonEmpty_insideIfCase.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(case)
@@ -94,11 +93,11 @@
                     parseBlock(), BlockKind(statement))
                       ensureBlock(), BlockKind(statement))
                       listener: beginBlock({, BlockKind(statement))
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlock(0, {, }, BlockKind(statement))
                 listener: endThenStatement({, })
                 listener: endIfStatement(if, null, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_list_typed_nonEmpty_insideNullAssert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_list_typed_nonEmpty_insideNullAssert.dart.intertwined.expect
index 8e44275..a7db4bf 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_list_typed_nonEmpty_insideNullAssert.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_list_typed_nonEmpty_insideNullAssert.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -109,10 +108,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_list_typed_nonEmpty_insideNullCheck.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_list_typed_nonEmpty_insideNullCheck.dart.intertwined.expect
index 4646d6c..dc4a9b6 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_list_typed_nonEmpty_insideNullCheck.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_list_typed_nonEmpty_insideNullCheck.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -109,10 +108,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_list_untyped_empty_insideCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_list_untyped_empty_insideCase.dart.intertwined.expect
index 4af0619..35c5da6 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_list_untyped_empty_insideCase.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_list_untyped_empty_insideCase.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -98,10 +97,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_list_untyped_empty_insideCast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_list_untyped_empty_insideCast.dart.intertwined.expect
index b9ffa39..003a7fa 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_list_untyped_empty_insideCast.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_list_untyped_empty_insideCast.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -105,10 +104,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_list_untyped_empty_insideIfCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_list_untyped_empty_insideIfCase.dart.intertwined.expect
index 1d6371f..4659bf7 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_list_untyped_empty_insideIfCase.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_list_untyped_empty_insideIfCase.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(case)
@@ -84,11 +83,11 @@
                     parseBlock(), BlockKind(statement))
                       ensureBlock(), BlockKind(statement))
                       listener: beginBlock({, BlockKind(statement))
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlock(0, {, }, BlockKind(statement))
                 listener: endThenStatement({, })
                 listener: endIfStatement(if, null, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_list_untyped_empty_insideNullAssert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_list_untyped_empty_insideNullAssert.dart.intertwined.expect
index b8956c6..e0d81cb 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_list_untyped_empty_insideNullAssert.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_list_untyped_empty_insideNullAssert.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -99,10 +98,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_list_untyped_empty_insideNullCheck.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_list_untyped_empty_insideNullCheck.dart.intertwined.expect
index 828fbdb..787390e 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_list_untyped_empty_insideNullCheck.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_list_untyped_empty_insideNullCheck.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -99,10 +98,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_list_untyped_nonEmpty_insideCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_list_untyped_nonEmpty_insideCase.dart.intertwined.expect
index 9a9d9f4..5b280e2 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_list_untyped_nonEmpty_insideCase.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_list_untyped_nonEmpty_insideCase.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -103,10 +102,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_list_untyped_nonEmpty_insideCast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_list_untyped_nonEmpty_insideCast.dart.intertwined.expect
index 4bfe9f5..b645c49 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_list_untyped_nonEmpty_insideCast.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_list_untyped_nonEmpty_insideCast.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -110,10 +109,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_list_untyped_nonEmpty_insideIfCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_list_untyped_nonEmpty_insideIfCase.dart.intertwined.expect
index 38c65d1..af80fc2 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_list_untyped_nonEmpty_insideIfCase.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_list_untyped_nonEmpty_insideIfCase.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(case)
@@ -89,11 +88,11 @@
                     parseBlock(), BlockKind(statement))
                       ensureBlock(), BlockKind(statement))
                       listener: beginBlock({, BlockKind(statement))
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlock(0, {, }, BlockKind(statement))
                 listener: endThenStatement({, })
                 listener: endIfStatement(if, null, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_list_untyped_nonEmpty_insideNullAssert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_list_untyped_nonEmpty_insideNullAssert.dart.intertwined.expect
index cacfe09..9cdc2d9 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_list_untyped_nonEmpty_insideNullAssert.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_list_untyped_nonEmpty_insideNullAssert.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -104,10 +103,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_list_untyped_nonEmpty_insideNullCheck.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_list_untyped_nonEmpty_insideNullCheck.dart.intertwined.expect
index 291587b..a6fd944 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_list_untyped_nonEmpty_insideNullCheck.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_list_untyped_nonEmpty_insideNullCheck.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -104,10 +103,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_map_typed_insideCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_map_typed_insideCase.dart.intertwined.expect
index e86afc2..b72bf56 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_map_typed_insideCase.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_map_typed_insideCase.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -120,10 +119,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_map_typed_insideCast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_map_typed_insideCast.dart.intertwined.expect
index 5f24878..fb1a624 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_map_typed_insideCast.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_map_typed_insideCast.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -127,10 +126,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_map_typed_insideIfCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_map_typed_insideIfCase.dart.intertwined.expect
index 983f00d..365bbea 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_map_typed_insideIfCase.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_map_typed_insideIfCase.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(case)
@@ -106,11 +105,11 @@
                     parseBlock(), BlockKind(statement))
                       ensureBlock(), BlockKind(statement))
                       listener: beginBlock({, BlockKind(statement))
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlock(0, {, }, BlockKind(statement))
                 listener: endThenStatement({, })
                 listener: endIfStatement(if, null, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_map_typed_insideNullAssert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_map_typed_insideNullAssert.dart.intertwined.expect
index 22e840f..1c19b58 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_map_typed_insideNullAssert.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_map_typed_insideNullAssert.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -121,10 +120,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_map_typed_insideNullCheck.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_map_typed_insideNullCheck.dart.intertwined.expect
index 73ca8e7..cf5c3d3 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_map_typed_insideNullCheck.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_map_typed_insideNullCheck.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -121,10 +120,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_map_untyped_insideCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_map_untyped_insideCase.dart.intertwined.expect
index c58f1f3..e74e3c4 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_map_untyped_insideCase.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_map_untyped_insideCase.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -112,10 +111,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_map_untyped_insideCast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_map_untyped_insideCast.dart.intertwined.expect
index 31974ab..17216d6 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_map_untyped_insideCast.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_map_untyped_insideCast.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -119,10 +118,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_map_untyped_insideIfCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_map_untyped_insideIfCase.dart.intertwined.expect
index 00475a2..5409750 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_map_untyped_insideIfCase.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_map_untyped_insideIfCase.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(case)
@@ -98,11 +97,11 @@
                     parseBlock(), BlockKind(statement))
                       ensureBlock(), BlockKind(statement))
                       listener: beginBlock({, BlockKind(statement))
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlock(0, {, }, BlockKind(statement))
                 listener: endThenStatement({, })
                 listener: endIfStatement(if, null, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_map_untyped_insideNullAssert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_map_untyped_insideNullAssert.dart.intertwined.expect
index e6c5f93..88c568c 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_map_untyped_insideNullAssert.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_map_untyped_insideNullAssert.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -113,10 +112,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_map_untyped_insideNullCheck.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_map_untyped_insideNullCheck.dart.intertwined.expect
index e0468ef..e138d4d 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_map_untyped_insideNullCheck.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_map_untyped_insideNullCheck.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -113,10 +112,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_objectExpression_insideCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_objectExpression_insideCase.dart.intertwined.expect
index 8ec968c..af31ea7 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_objectExpression_insideCase.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_objectExpression_insideCase.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -79,7 +78,6 @@
                             parseSendOrFunctionLiteral(const, expression, ConstantPatternContext.explicit)
                               looksLikeFunctionBody(:)
                               parseSend(const, expression, ConstantPatternContext.explicit)
-                                isNextIdentifier(const)
                                 ensureIdentifier(const, expression)
                                   listener: handleIdentifier(Foo, expression)
                                 listener: handleNoTypeArguments(()
@@ -113,10 +111,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_objectExpression_insideCast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_objectExpression_insideCast.dart.intertwined.expect
index f6d7883..5c3d1cd 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_objectExpression_insideCast.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_objectExpression_insideCast.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -79,7 +78,6 @@
                             parseSendOrFunctionLiteral(const, expression, ConstantPatternContext.explicit)
                               looksLikeFunctionBody(as)
                               parseSend(const, expression, ConstantPatternContext.explicit)
-                                isNextIdentifier(const)
                                 ensureIdentifier(const, expression)
                                   listener: handleIdentifier(Foo, expression)
                                 listener: handleNoTypeArguments(()
@@ -120,10 +118,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_objectExpression_insideIfCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_objectExpression_insideIfCase.dart.intertwined.expect
index 6ef154f..86db972 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_objectExpression_insideIfCase.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_objectExpression_insideIfCase.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(case)
@@ -71,7 +70,6 @@
                               parseSendOrFunctionLiteral(const, expression, ConstantPatternContext.explicit)
                                 looksLikeFunctionBody())
                                 parseSend(const, expression, ConstantPatternContext.explicit)
-                                  isNextIdentifier(const)
                                   ensureIdentifier(const, expression)
                                     listener: handleIdentifier(Foo, expression)
                                   listener: handleNoTypeArguments(()
@@ -99,11 +97,11 @@
                     parseBlock(), BlockKind(statement))
                       ensureBlock(), BlockKind(statement))
                       listener: beginBlock({, BlockKind(statement))
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlock(0, {, }, BlockKind(statement))
                 listener: endThenStatement({, })
                 listener: endIfStatement(if, null, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_objectExpression_insideNullAssert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_objectExpression_insideNullAssert.dart.intertwined.expect
index 338536a..b810fec 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_objectExpression_insideNullAssert.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_objectExpression_insideNullAssert.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -79,7 +78,6 @@
                             parseSendOrFunctionLiteral(const, expression, ConstantPatternContext.explicit)
                               looksLikeFunctionBody(!)
                               parseSend(const, expression, ConstantPatternContext.explicit)
-                                isNextIdentifier(const)
                                 ensureIdentifier(const, expression)
                                   listener: handleIdentifier(Foo, expression)
                                 listener: handleNoTypeArguments(()
@@ -114,10 +112,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_objectExpression_insideNullCheck.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_objectExpression_insideNullCheck.dart.intertwined.expect
index 769ce98..a45d707 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_objectExpression_insideNullCheck.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_objectExpression_insideNullCheck.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -79,7 +78,6 @@
                             parseSendOrFunctionLiteral(const, expression, ConstantPatternContext.explicit)
                               looksLikeFunctionBody(?)
                               parseSend(const, expression, ConstantPatternContext.explicit)
-                                isNextIdentifier(const)
                                 ensureIdentifier(const, expression)
                                   listener: handleIdentifier(Foo, expression)
                                 listener: handleNoTypeArguments(()
@@ -114,10 +112,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_parenthesized_insideCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_parenthesized_insideCase.dart.intertwined.expect
index 6ab02bb..872dbf1 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_parenthesized_insideCase.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_parenthesized_insideCase.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -105,10 +104,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_parenthesized_insideCast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_parenthesized_insideCast.dart.intertwined.expect
index 45bf0c0..b8be779 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_parenthesized_insideCast.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_parenthesized_insideCast.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -112,10 +111,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_parenthesized_insideIfCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_parenthesized_insideIfCase.dart.intertwined.expect
index 6a9460c..3381c42 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_parenthesized_insideIfCase.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_parenthesized_insideIfCase.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(case)
@@ -91,11 +90,11 @@
                     parseBlock(), BlockKind(statement))
                       ensureBlock(), BlockKind(statement))
                       listener: beginBlock({, BlockKind(statement))
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlock(0, {, }, BlockKind(statement))
                 listener: endThenStatement({, })
                 listener: endIfStatement(if, null, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_parenthesized_insideNullAssert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_parenthesized_insideNullAssert.dart.intertwined.expect
index 870a6005..18f5d52 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_parenthesized_insideNullAssert.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_parenthesized_insideNullAssert.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -106,10 +105,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_parenthesized_insideNullCheck.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_parenthesized_insideNullCheck.dart.intertwined.expect
index d9329f7..ccf21ec 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_parenthesized_insideNullCheck.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_parenthesized_insideNullCheck.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -106,10 +105,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_set_typed_insideCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_set_typed_insideCase.dart.intertwined.expect
index 525a735..92ac47b 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_set_typed_insideCase.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_set_typed_insideCase.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -108,10 +107,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_set_typed_insideCast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_set_typed_insideCast.dart.intertwined.expect
index e4b9525..6d0442d 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_set_typed_insideCast.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_set_typed_insideCast.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -115,10 +114,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_set_typed_insideIfCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_set_typed_insideIfCase.dart.intertwined.expect
index 3d8812f..d0754ff 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_set_typed_insideIfCase.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_set_typed_insideIfCase.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(case)
@@ -94,11 +93,11 @@
                     parseBlock(), BlockKind(statement))
                       ensureBlock(), BlockKind(statement))
                       listener: beginBlock({, BlockKind(statement))
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlock(0, {, }, BlockKind(statement))
                 listener: endThenStatement({, })
                 listener: endIfStatement(if, null, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_set_typed_insideNullAssert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_set_typed_insideNullAssert.dart.intertwined.expect
index af61fdd..bf6e341 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_set_typed_insideNullAssert.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_set_typed_insideNullAssert.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -109,10 +108,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_set_typed_insideNullCheck.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_set_typed_insideNullCheck.dart.intertwined.expect
index cfed501..7228f11 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_set_typed_insideNullCheck.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_set_typed_insideNullCheck.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -109,10 +108,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_set_untyped_insideCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_set_untyped_insideCase.dart.intertwined.expect
index d99b37d..ce7bf89 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_set_untyped_insideCase.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_set_untyped_insideCase.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -103,10 +102,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_set_untyped_insideCast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_set_untyped_insideCast.dart.intertwined.expect
index 0a4c8f6..f268daf 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_set_untyped_insideCast.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_set_untyped_insideCast.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -110,10 +109,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_set_untyped_insideIfCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_set_untyped_insideIfCase.dart.intertwined.expect
index f30bbff..5978dc0 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_set_untyped_insideIfCase.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_set_untyped_insideIfCase.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(case)
@@ -89,11 +88,11 @@
                     parseBlock(), BlockKind(statement))
                       ensureBlock(), BlockKind(statement))
                       listener: beginBlock({, BlockKind(statement))
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlock(0, {, }, BlockKind(statement))
                 listener: endThenStatement({, })
                 listener: endIfStatement(if, null, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_set_untyped_insideNullAssert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_set_untyped_insideNullAssert.dart.intertwined.expect
index 6ac8cd0..d4301bc 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_set_untyped_insideNullAssert.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_set_untyped_insideNullAssert.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -104,10 +103,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/constant_set_untyped_insideNullCheck.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_set_untyped_insideNullCheck.dart.intertwined.expect
index 44d369f..4f0e325 100644
--- a/pkg/front_end/parser_testcases/patterns/constant_set_untyped_insideNullCheck.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/constant_set_untyped_insideNullCheck.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -104,10 +103,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/declaredVariable_inPatternAssignment_usingFinal.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/declaredVariable_inPatternAssignment_usingFinal.dart.intertwined.expect
index bbf2b03..c34efae 100644
--- a/pkg/front_end/parser_testcases/patterns/declaredVariable_inPatternAssignment_usingFinal.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/declaredVariable_inPatternAssignment_usingFinal.dart.intertwined.expect
@@ -25,7 +25,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, [)
+          notEofOrType(CLOSE_CURLY_BRACKET, [)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -67,7 +67,6 @@
                               parsePrimary(=, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                   parseSend(=, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(=)
                                     ensureIdentifier(=, expression)
                                       listener: handleIdentifier(y, expression)
                                     listener: handleNoTypeArguments(;)
@@ -77,7 +76,7 @@
                         listener: handlePatternAssignment(=)
                     ensureSemicolon(y)
                     listener: handleExpressionStatement([, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/declaredVariable_inPatternAssignment_usingFinalAndType.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/declaredVariable_inPatternAssignment_usingFinalAndType.dart.intertwined.expect
index b6c5f4b..0507db1 100644
--- a/pkg/front_end/parser_testcases/patterns/declaredVariable_inPatternAssignment_usingFinalAndType.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/declaredVariable_inPatternAssignment_usingFinalAndType.dart.intertwined.expect
@@ -25,7 +25,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, [)
+          notEofOrType(CLOSE_CURLY_BRACKET, [)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -69,7 +69,6 @@
                               parsePrimary(=, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                   parseSend(=, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(=)
                                     ensureIdentifier(=, expression)
                                       listener: handleIdentifier(y, expression)
                                     listener: handleNoTypeArguments(;)
@@ -79,7 +78,7 @@
                         listener: handlePatternAssignment(=)
                     ensureSemicolon(y)
                     listener: handleExpressionStatement([, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/declaredVariable_inPatternAssignment_usingType.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/declaredVariable_inPatternAssignment_usingType.dart.intertwined.expect
index 5cc58ea..e21c507 100644
--- a/pkg/front_end/parser_testcases/patterns/declaredVariable_inPatternAssignment_usingType.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/declaredVariable_inPatternAssignment_usingType.dart.intertwined.expect
@@ -25,7 +25,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, [)
+          notEofOrType(CLOSE_CURLY_BRACKET, [)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -69,7 +69,6 @@
                               parsePrimary(=, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                   parseSend(=, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(=)
                                     ensureIdentifier(=, expression)
                                       listener: handleIdentifier(y, expression)
                                     listener: handleNoTypeArguments(;)
@@ -79,7 +78,7 @@
                         listener: handlePatternAssignment(=)
                     ensureSemicolon(y)
                     listener: handleExpressionStatement([, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/declaredVariable_inPatternAssignment_usingVar.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/declaredVariable_inPatternAssignment_usingVar.dart.intertwined.expect
index e02b72a..c64663c 100644
--- a/pkg/front_end/parser_testcases/patterns/declaredVariable_inPatternAssignment_usingVar.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/declaredVariable_inPatternAssignment_usingVar.dart.intertwined.expect
@@ -25,7 +25,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, [)
+          notEofOrType(CLOSE_CURLY_BRACKET, [)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -67,7 +67,6 @@
                               parsePrimary(=, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                   parseSend(=, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(=)
                                     ensureIdentifier(=, expression)
                                       listener: handleIdentifier(y, expression)
                                     listener: handleNoTypeArguments(;)
@@ -77,7 +76,7 @@
                         listener: handlePatternAssignment(=)
                     ensureSemicolon(y)
                     listener: handleExpressionStatement([, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/declaredVariable_inPatternAssignment_usingVarAndType.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/declaredVariable_inPatternAssignment_usingVarAndType.dart.intertwined.expect
index 255b852..b630be5 100644
--- a/pkg/front_end/parser_testcases/patterns/declaredVariable_inPatternAssignment_usingVarAndType.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/declaredVariable_inPatternAssignment_usingVarAndType.dart.intertwined.expect
@@ -25,7 +25,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, [)
+          notEofOrType(CLOSE_CURLY_BRACKET, [)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -69,7 +69,6 @@
                               parsePrimary(=, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                   parseSend(=, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(=)
                                     ensureIdentifier(=, expression)
                                       listener: handleIdentifier(y, expression)
                                     listener: handleNoTypeArguments(;)
@@ -79,7 +78,7 @@
                         listener: handlePatternAssignment(=)
                     ensureSemicolon(y)
                     listener: handleExpressionStatement([, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/double_literal_inside_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/double_literal_inside_case.dart.intertwined.expect
index d3a3ae4..54146d2 100644
--- a/pkg/front_end/parser_testcases/patterns/double_literal_inside_case.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/double_literal_inside_case.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -94,10 +93,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/double_literal_inside_cast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/double_literal_inside_cast.dart.intertwined.expect
index fe18c76..0064a0c 100644
--- a/pkg/front_end/parser_testcases/patterns/double_literal_inside_cast.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/double_literal_inside_cast.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -101,10 +100,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/double_literal_inside_if_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/double_literal_inside_if_case.dart.intertwined.expect
index b381dd6..858a1cb 100644
--- a/pkg/front_end/parser_testcases/patterns/double_literal_inside_if_case.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/double_literal_inside_if_case.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(case)
@@ -80,11 +79,11 @@
                     parseBlock(), BlockKind(statement))
                       ensureBlock(), BlockKind(statement))
                       listener: beginBlock({, BlockKind(statement))
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlock(0, {, }, BlockKind(statement))
                 listener: endThenStatement({, })
                 listener: endIfStatement(if, null, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/double_literal_inside_null_assert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/double_literal_inside_null_assert.dart.intertwined.expect
index 927a670..be8355a 100644
--- a/pkg/front_end/parser_testcases/patterns/double_literal_inside_null_assert.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/double_literal_inside_null_assert.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -95,10 +94,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/double_literal_inside_null_check.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/double_literal_inside_null_check.dart.intertwined.expect
index 340a594..e070291e 100644
--- a/pkg/front_end/parser_testcases/patterns/double_literal_inside_null_check.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/double_literal_inside_null_check.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -95,10 +94,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/error_recovery_after_question_suffix_in_expression.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/error_recovery_after_question_suffix_in_expression.dart.intertwined.expect
index b89ed8f..4634012 100644
--- a/pkg/front_end/parser_testcases/patterns/error_recovery_after_question_suffix_in_expression.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/error_recovery_after_question_suffix_in_expression.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, try)
+          notEofOrType(CLOSE_CURLY_BRACKET, try)
           parseStatement({)
             parseStatementX({)
               parseTryStatement({)
@@ -34,7 +34,7 @@
                 parseBlock(try, BlockKind(try statement))
                   ensureBlock(try, BlockKind(try statement))
                   listener: beginBlock({, BlockKind(try statement))
-                  notEofOrValue(}, true)
+                  notEofOrType(CLOSE_CURLY_BRACKET, true)
                   parseStatement({)
                     parseStatementX({)
                       parseExpressionStatementOrDeclaration({, null)
@@ -56,7 +56,6 @@
                                       parseUnaryExpression(?, false, ConstantPatternContext.none)
                                         parsePrimary(?, expression, ConstantPatternContext.none)
                                           parseSend(?, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(?)
                                             ensureIdentifier(?, expression)
                                               reportRecoverableErrorWithToken(:, Template(ExpectedIdentifier))
                                                 listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got ':'., Try inserting an identifier before ':'., {lexeme: :}], :, :)
@@ -77,7 +76,7 @@
                                   listener: endConditionalExpression(?, :, 2)
                             ensureSemicolon(2)
                             listener: handleExpressionStatement(true, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlock(1, {, }, BlockKind(try statement))
                 listener: beginCatchClause(catch)
                 parseFormalParameters(catch, MemberKind.Catch)
@@ -98,11 +97,11 @@
                 parseBlock(), BlockKind(catch clause))
                   ensureBlock(), BlockKind(catch clause))
                   listener: beginBlock({, BlockKind(catch clause))
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlock(0, {, }, BlockKind(catch clause))
                 listener: handleCatchBlock(null, catch, null)
                 listener: endTryStatement(1, try, null, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(f, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/extractor_pattern_inside_cast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/extractor_pattern_inside_cast.dart.intertwined.expect
index 7be2bbe..0a071a4 100644
--- a/pkg/front_end/parser_testcases/patterns/extractor_pattern_inside_cast.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/extractor_pattern_inside_cast.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(C, DeclarationKind.Class, C)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, C)
               parseMetadataStar({)
                 listener: beginMetadataStar(int)
@@ -42,7 +42,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -82,7 +82,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -98,7 +98,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -110,7 +109,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -156,10 +155,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/extractor_pattern_inside_null_assert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/extractor_pattern_inside_null_assert.dart.intertwined.expect
index c132c91..2df2dc7 100644
--- a/pkg/front_end/parser_testcases/patterns/extractor_pattern_inside_null_assert.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/extractor_pattern_inside_null_assert.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(C, DeclarationKind.Class, C)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, C)
               parseMetadataStar({)
                 listener: beginMetadataStar(int)
@@ -42,7 +42,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -82,7 +82,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -98,7 +98,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -110,7 +109,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -150,10 +149,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/extractor_pattern_inside_null_check.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/extractor_pattern_inside_null_check.dart.intertwined.expect
index fd995af..a0c3cab 100644
--- a/pkg/front_end/parser_testcases/patterns/extractor_pattern_inside_null_check.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/extractor_pattern_inside_null_check.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(C, DeclarationKind.Class, C)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, C)
               parseMetadataStar({)
                 listener: beginMetadataStar(int)
@@ -42,7 +42,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -82,7 +82,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -98,7 +98,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -110,7 +109,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -150,10 +149,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/extractor_pattern_with_type_args.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/extractor_pattern_with_type_args.dart.intertwined.expect
index 9f63aeb..2ed348c 100644
--- a/pkg/front_end/parser_testcases/patterns/extractor_pattern_with_type_args.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/extractor_pattern_with_type_args.dart.intertwined.expect
@@ -33,7 +33,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(>, DeclarationKind.Class, C)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -73,7 +73,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -89,7 +89,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -101,7 +100,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -130,10 +129,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/extractor_pattern_with_type_args_inside_null_assert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/extractor_pattern_with_type_args_inside_null_assert.dart.intertwined.expect
index 5a7e7e7..8a7694a 100644
--- a/pkg/front_end/parser_testcases/patterns/extractor_pattern_with_type_args_inside_null_assert.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/extractor_pattern_with_type_args_inside_null_assert.dart.intertwined.expect
@@ -33,7 +33,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(>, DeclarationKind.Class, C)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, T)
+            notEofOrType(CLOSE_CURLY_BRACKET, T)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, C)
               parseMetadataStar({)
                 listener: beginMetadataStar(T)
@@ -50,7 +50,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, T, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -90,7 +90,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -106,7 +106,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -118,7 +117,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -162,10 +161,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/extractor_prefixedNamedUnderscore_withTypeArgs_insideCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/extractor_prefixedNamedUnderscore_withTypeArgs_insideCase.dart.intertwined.expect
index b197f34..0fceba0 100644
--- a/pkg/front_end/parser_testcases/patterns/extractor_prefixedNamedUnderscore_withTypeArgs_insideCase.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/extractor_prefixedNamedUnderscore_withTypeArgs_insideCase.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -92,10 +91,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/extractor_prefixedNamedUnderscore_withoutTypeArgs_insideCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/extractor_prefixedNamedUnderscore_withoutTypeArgs_insideCase.dart.intertwined.expect
index f112ef1..d6d25e8 100644
--- a/pkg/front_end/parser_testcases/patterns/extractor_prefixedNamedUnderscore_withoutTypeArgs_insideCase.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/extractor_prefixedNamedUnderscore_withoutTypeArgs_insideCase.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -88,10 +87,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/extractor_unprefixedNamedUnderscore_withTypeArgs_insideCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/extractor_unprefixedNamedUnderscore_withTypeArgs_insideCase.dart.intertwined.expect
index da2a0ff..a23fdf9 100644
--- a/pkg/front_end/parser_testcases/patterns/extractor_unprefixedNamedUnderscore_withTypeArgs_insideCase.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/extractor_unprefixedNamedUnderscore_withTypeArgs_insideCase.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -92,10 +91,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/extractor_unprefixedNamedUnderscore_withoutTypeArgs_insideCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/extractor_unprefixedNamedUnderscore_withoutTypeArgs_insideCase.dart.intertwined.expect
index 7266d20..5739b7c 100644
--- a/pkg/front_end/parser_testcases/patterns/extractor_unprefixedNamedUnderscore_withoutTypeArgs_insideCase.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/extractor_unprefixedNamedUnderscore_withoutTypeArgs_insideCase.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -88,10 +87,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/final_variable_inside_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/final_variable_inside_case.dart.intertwined.expect
index 46230a7..d386211 100644
--- a/pkg/front_end/parser_testcases/patterns/final_variable_inside_case.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/final_variable_inside_case.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -90,10 +89,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/final_variable_inside_cast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/final_variable_inside_cast.dart.intertwined.expect
index 509d0f7..06ab181 100644
--- a/pkg/front_end/parser_testcases/patterns/final_variable_inside_cast.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/final_variable_inside_cast.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -97,10 +96,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/final_variable_inside_if_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/final_variable_inside_if_case.dart.intertwined.expect
index bdf3d47..02561be 100644
--- a/pkg/front_end/parser_testcases/patterns/final_variable_inside_if_case.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/final_variable_inside_if_case.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(case)
@@ -76,11 +75,11 @@
                     parseBlock(), BlockKind(statement))
                       ensureBlock(), BlockKind(statement))
                       listener: beginBlock({, BlockKind(statement))
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlock(0, {, }, BlockKind(statement))
                 listener: endThenStatement({, })
                 listener: endIfStatement(if, null, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/final_variable_inside_null_assert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/final_variable_inside_null_assert.dart.intertwined.expect
index 9cb6f868..e973c2b 100644
--- a/pkg/front_end/parser_testcases/patterns/final_variable_inside_null_assert.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/final_variable_inside_null_assert.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -91,10 +90,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/final_variable_inside_null_check.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/final_variable_inside_null_check.dart.intertwined.expect
index 39c556c..fa7d8ef 100644
--- a/pkg/front_end/parser_testcases/patterns/final_variable_inside_null_check.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/final_variable_inside_null_check.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -91,10 +90,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_afterSwitchExpression.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_afterSwitchExpression.dart.intertwined.expect
index a7d9de2..ffec17e 100644
--- a/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_afterSwitchExpression.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_afterSwitchExpression.dart.intertwined.expect
@@ -56,7 +56,6 @@
                                 parsePrimary((, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                     parseSend((, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(()
                                       ensureIdentifier((, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments())
diff --git a/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideIfCaseWhenClause_element.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideIfCaseWhenClause_element.dart.intertwined.expect
index e1ad9e0..1c3a0fd 100644
--- a/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideIfCaseWhenClause_element.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideIfCaseWhenClause_element.dart.intertwined.expect
@@ -66,7 +66,6 @@
                                 parsePrimary((, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                     parseSend((, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(()
                                       ensureIdentifier((, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments(case)
@@ -90,7 +89,6 @@
                                 parsePrimary(when, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral(when, expression, ConstantPatternContext.none)
                                     parseSend(when, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(when)
                                       ensureIdentifier(when, expression)
                                         listener: handleIdentifier(y, expression)
                                       listener: handleNoTypeArguments(+)
diff --git a/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideIfCaseWhenClause_statement.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideIfCaseWhenClause_statement.dart.intertwined.expect
index 2fd04b3..b9a9958 100644
--- a/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideIfCaseWhenClause_statement.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideIfCaseWhenClause_statement.dart.intertwined.expect
@@ -46,7 +46,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -62,7 +62,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(case)
@@ -86,7 +85,6 @@
                           parsePrimary(when, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(when, expression, ConstantPatternContext.none)
                               parseSend(when, expression, ConstantPatternContext.none)
-                                isNextIdentifier(when)
                                 ensureIdentifier(when, expression)
                                   listener: handleIdentifier(y, expression)
                                 listener: handleNoTypeArguments(+)
@@ -132,11 +130,11 @@
                     parseBlock(), BlockKind(statement))
                       ensureBlock(), BlockKind(statement))
                       listener: beginBlock({, BlockKind(statement))
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlock(0, {, }, BlockKind(statement))
                 listener: endThenStatement({, })
                 listener: endIfStatement(if, null, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(f, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideListPattern.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideListPattern.dart.intertwined.expect
index b927dab..1f04f49 100644
--- a/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideListPattern.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideListPattern.dart.intertwined.expect
@@ -56,7 +56,6 @@
                                 parsePrimary((, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                     parseSend((, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(()
                                       ensureIdentifier((, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments())
diff --git a/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideMapPattern.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideMapPattern.dart.intertwined.expect
index c5efabc..3dd6e7f 100644
--- a/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideMapPattern.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideMapPattern.dart.intertwined.expect
@@ -56,7 +56,6 @@
                                 parsePrimary((, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                     parseSend((, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(()
                                       ensureIdentifier((, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments())
diff --git a/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideObjectPattern.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideObjectPattern.dart.intertwined.expect
index db57499..ee4d894 100644
--- a/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideObjectPattern.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideObjectPattern.dart.intertwined.expect
@@ -56,7 +56,6 @@
                                 parsePrimary((, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                     parseSend((, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(()
                                       ensureIdentifier((, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments())
diff --git a/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideParenthesizedConstPattern.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideParenthesizedConstPattern.dart.intertwined.expect
index 2867240..4321e13 100644
--- a/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideParenthesizedConstPattern.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideParenthesizedConstPattern.dart.intertwined.expect
@@ -56,7 +56,6 @@
                                 parsePrimary((, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                     parseSend((, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(()
                                       ensureIdentifier((, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments())
diff --git a/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideParenthesizedPattern.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideParenthesizedPattern.dart.intertwined.expect
index 5562cd8..7099d43 100644
--- a/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideParenthesizedPattern.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideParenthesizedPattern.dart.intertwined.expect
@@ -56,7 +56,6 @@
                                 parsePrimary((, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                     parseSend((, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(()
                                       ensureIdentifier((, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments())
diff --git a/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideSwitchExpressionCase_guarded.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideSwitchExpressionCase_guarded.dart.intertwined.expect
index 2d36201..be4f34f 100644
--- a/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideSwitchExpressionCase_guarded.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideSwitchExpressionCase_guarded.dart.intertwined.expect
@@ -56,7 +56,6 @@
                                 parsePrimary((, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                     parseSend((, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(()
                                       ensureIdentifier((, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments())
@@ -96,7 +95,6 @@
                                           parsePrimary((, expression, ConstantPatternContext.none)
                                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                               parseSend((, expression, ConstantPatternContext.none)
-                                                isNextIdentifier(()
                                                 ensureIdentifier((, expression)
                                                   listener: handleIdentifier(x, expression)
                                                 listener: handleNoTypeArguments())
diff --git a/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideSwitchExpressionCase_unguarded.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideSwitchExpressionCase_unguarded.dart.intertwined.expect
index b5716d1..d3b7955 100644
--- a/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideSwitchExpressionCase_unguarded.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideSwitchExpressionCase_unguarded.dart.intertwined.expect
@@ -56,7 +56,6 @@
                                 parsePrimary((, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                     parseSend((, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(()
                                       ensureIdentifier((, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments())
@@ -96,7 +95,6 @@
                                           parsePrimary((, expression, ConstantPatternContext.none)
                                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                               parseSend((, expression, ConstantPatternContext.none)
-                                                isNextIdentifier(()
                                                 ensureIdentifier((, expression)
                                                   listener: handleIdentifier(x, expression)
                                                 listener: handleNoTypeArguments())
diff --git a/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideSwitchStatementInWhenClause.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideSwitchStatementInWhenClause.dart.intertwined.expect
index 7cc783b..d38fb33 100644
--- a/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideSwitchStatementInWhenClause.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideSwitchStatementInWhenClause.dart.intertwined.expect
@@ -46,7 +46,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -62,7 +62,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -74,7 +73,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -94,7 +93,6 @@
                         parsePrimary(when, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(when, expression, ConstantPatternContext.none)
                             parseSend(when, expression, ConstantPatternContext.none)
-                              isNextIdentifier(when)
                               ensureIdentifier(when, expression)
                                 listener: handleIdentifier(y, expression)
                               listener: handleNoTypeArguments(+)
@@ -145,10 +143,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(f, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_afterListPattern.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_afterListPattern.dart.intertwined.expect
index 7106d48..a411f67 100644
--- a/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_afterListPattern.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_afterListPattern.dart.intertwined.expect
@@ -56,7 +56,6 @@
                                 parsePrimary((, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                     parseSend((, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(()
                                       ensureIdentifier((, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments())
diff --git a/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_afterMapPattern.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_afterMapPattern.dart.intertwined.expect
index b1af9e3..95a082e 100644
--- a/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_afterMapPattern.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_afterMapPattern.dart.intertwined.expect
@@ -56,7 +56,6 @@
                                 parsePrimary((, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                     parseSend((, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(()
                                       ensureIdentifier((, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments())
diff --git a/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_afterObjectPattern.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_afterObjectPattern.dart.intertwined.expect
index 3cf2e75..e4cd0a0 100644
--- a/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_afterObjectPattern.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_afterObjectPattern.dart.intertwined.expect
@@ -56,7 +56,6 @@
                                 parsePrimary((, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                     parseSend((, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(()
                                       ensureIdentifier((, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments())
diff --git a/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_afterParenthesizedPattern.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_afterParenthesizedPattern.dart.intertwined.expect
index e194b3b..f559b03 100644
--- a/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_afterParenthesizedPattern.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_afterParenthesizedPattern.dart.intertwined.expect
@@ -56,7 +56,6 @@
                                 parsePrimary((, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                     parseSend((, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(()
                                       ensureIdentifier((, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments())
diff --git a/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_afterSwitchExpressionInWhenClause.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_afterSwitchExpressionInWhenClause.dart.intertwined.expect
index b9efeac..7180320 100644
--- a/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_afterSwitchExpressionInWhenClause.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_afterSwitchExpressionInWhenClause.dart.intertwined.expect
@@ -56,7 +56,6 @@
                                 parsePrimary((, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                     parseSend((, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(()
                                       ensureIdentifier((, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments())
@@ -96,7 +95,6 @@
                                           parsePrimary((, expression, ConstantPatternContext.none)
                                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                               parseSend((, expression, ConstantPatternContext.none)
-                                                isNextIdentifier(()
                                                 ensureIdentifier((, expression)
                                                   listener: handleIdentifier(x, expression)
                                                 listener: handleNoTypeArguments())
diff --git a/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_insideSwitchExpressionInWhenClause.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_insideSwitchExpressionInWhenClause.dart.intertwined.expect
index 7e65989..6f967ff 100644
--- a/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_insideSwitchExpressionInWhenClause.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_insideSwitchExpressionInWhenClause.dart.intertwined.expect
@@ -66,7 +66,6 @@
                                 parsePrimary((, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                     parseSend((, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(()
                                       ensureIdentifier((, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments())
@@ -95,7 +94,6 @@
                             parsePrimary(when, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(when, expression, ConstantPatternContext.none)
                                 parseSend(when, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(when)
                                   ensureIdentifier(when, expression)
                                     listener: handleIdentifier(y, expression)
                                   listener: handleNoTypeArguments(+)
diff --git a/pkg/front_end/parser_testcases/patterns/identifier_as_when.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/identifier_as_when.dart.intertwined.expect
index 2d20630..ab3878c 100644
--- a/pkg/front_end/parser_testcases/patterns/identifier_as_when.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/identifier_as_when.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -75,7 +74,6 @@
                           parsePrimary(case, expression, ConstantPatternContext.implicit)
                             parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.implicit)
                               parseSend(case, expression, ConstantPatternContext.implicit)
-                                isNextIdentifier(case)
                                 ensureIdentifier(case, expression)
                                   listener: handleIdentifier(foo, expression)
                                 listener: handleNoTypeArguments(as)
@@ -98,10 +96,10 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/identifier_when_as.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/identifier_when_as.dart.intertwined.expect
index e0aaf5f..0cad5db 100644
--- a/pkg/front_end/parser_testcases/patterns/identifier_when_as.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/identifier_when_as.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -75,7 +74,6 @@
                           parsePrimary(case, expression, ConstantPatternContext.implicit)
                             parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.implicit)
                               parseSend(case, expression, ConstantPatternContext.implicit)
-                                isNextIdentifier(case)
                                 ensureIdentifier(case, expression)
                                   listener: handleIdentifier(foo, expression)
                                 listener: handleNoTypeArguments(when)
@@ -95,7 +93,6 @@
                           inPlainSync()
                           parseSendOrFunctionLiteral(when, expression, ConstantPatternContext.none)
                             parseSend(when, expression, ConstantPatternContext.none)
-                              isNextIdentifier(when)
                               ensureIdentifier(when, expression)
                                 inPlainSync()
                                 listener: handleIdentifier(as, expression)
@@ -110,10 +107,10 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/identifier_when_not.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/identifier_when_not.dart.intertwined.expect
index d83dadf..e3f95d2 100644
--- a/pkg/front_end/parser_testcases/patterns/identifier_when_not.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/identifier_when_not.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -75,7 +74,6 @@
                           parsePrimary(case, expression, ConstantPatternContext.implicit)
                             parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.implicit)
                               parseSend(case, expression, ConstantPatternContext.implicit)
-                                isNextIdentifier(case)
                                 ensureIdentifier(case, expression)
                                   listener: handleIdentifier(foo, expression)
                                 listener: handleNoTypeArguments(when)
@@ -95,7 +93,6 @@
                             parsePrimary(!, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(!, expression, ConstantPatternContext.none)
                                 parseSend(!, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(!)
                                   ensureIdentifier(!, expression)
                                     listener: handleIdentifier(flag, expression)
                                   listener: handleNoTypeArguments(:)
@@ -110,10 +107,10 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/identifier_when_when.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/identifier_when_when.dart.intertwined.expect
index 7a1c6e5..eafe286 100644
--- a/pkg/front_end/parser_testcases/patterns/identifier_when_when.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/identifier_when_when.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -75,7 +74,6 @@
                           parsePrimary(case, expression, ConstantPatternContext.implicit)
                             parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.implicit)
                               parseSend(case, expression, ConstantPatternContext.implicit)
-                                isNextIdentifier(case)
                                 ensureIdentifier(case, expression)
                                   listener: handleIdentifier(foo, expression)
                                 listener: handleNoTypeArguments(when)
@@ -95,7 +93,6 @@
                           inPlainSync()
                           parseSendOrFunctionLiteral(when, expression, ConstantPatternContext.none)
                             parseSend(when, expression, ConstantPatternContext.none)
-                              isNextIdentifier(when)
                               ensureIdentifier(when, expression)
                                 inPlainSync()
                                 listener: handleIdentifier(when, expression)
@@ -110,10 +107,10 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/integer_literal_inside_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/integer_literal_inside_case.dart.intertwined.expect
index 7c32cca..9a06d94 100644
--- a/pkg/front_end/parser_testcases/patterns/integer_literal_inside_case.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/integer_literal_inside_case.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -94,10 +93,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/integer_literal_inside_cast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/integer_literal_inside_cast.dart.intertwined.expect
index 8ca2343..b2afd4f 100644
--- a/pkg/front_end/parser_testcases/patterns/integer_literal_inside_cast.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/integer_literal_inside_cast.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -101,10 +100,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/integer_literal_inside_if_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/integer_literal_inside_if_case.dart.intertwined.expect
index d50476c..d5c9057 100644
--- a/pkg/front_end/parser_testcases/patterns/integer_literal_inside_if_case.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/integer_literal_inside_if_case.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(case)
@@ -80,11 +79,11 @@
                     parseBlock(), BlockKind(statement))
                       ensureBlock(), BlockKind(statement))
                       listener: beginBlock({, BlockKind(statement))
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlock(0, {, }, BlockKind(statement))
                 listener: endThenStatement({, })
                 listener: endIfStatement(if, null, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/integer_literal_inside_null_assert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/integer_literal_inside_null_assert.dart.intertwined.expect
index 579afac..82e5f28 100644
--- a/pkg/front_end/parser_testcases/patterns/integer_literal_inside_null_assert.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/integer_literal_inside_null_assert.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -95,10 +94,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/integer_literal_inside_null_check.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/integer_literal_inside_null_check.dart.intertwined.expect
index 0a26c2c..b93b385 100644
--- a/pkg/front_end/parser_testcases/patterns/integer_literal_inside_null_check.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/integer_literal_inside_null_check.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -95,10 +94,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/issue50591.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/issue50591.dart.intertwined.expect
index e88b3e0..4bafe7c 100644
--- a/pkg/front_end/parser_testcases/patterns/issue50591.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/issue50591.dart.intertwined.expect
@@ -76,7 +76,6 @@
                                 parsePrimary((, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                     parseSend((, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(()
                                       ensureIdentifier((, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments())
@@ -105,7 +104,6 @@
                             parsePrimary(when, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(when, expression, ConstantPatternContext.none)
                                 parseSend(when, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(when)
                                   ensureIdentifier(when, expression)
                                     listener: handleIdentifier(a, expression)
                                   listener: handleNoTypeArguments(()
diff --git a/pkg/front_end/parser_testcases/patterns/issue50591_example2.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/issue50591_example2.dart.intertwined.expect
index 545b492..0d3ed69 100644
--- a/pkg/front_end/parser_testcases/patterns/issue50591_example2.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/issue50591_example2.dart.intertwined.expect
@@ -37,7 +37,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -73,7 +73,6 @@
                                                     parsePrimary((, expression, ConstantPatternContext.none)
                                                       parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                         parseSend((, expression, ConstantPatternContext.none)
-                                                          isNextIdentifier(()
                                                           ensureIdentifier((, expression)
                                                             listener: handleIdentifier(x, expression)
                                                           listener: handleNoTypeArguments())
@@ -94,7 +93,6 @@
                                                   parsePrimary(const, expression, ConstantPatternContext.explicit)
                                                     parseSendOrFunctionLiteral(const, expression, ConstantPatternContext.explicit)
                                                       parseSend(const, expression, ConstantPatternContext.explicit)
-                                                        isNextIdentifier(const)
                                                         ensureIdentifier(const, expression)
                                                           listener: handleIdentifier(A, expression)
                                                         listener: handleNoTypeArguments(()
@@ -142,7 +140,7 @@
                                 listener: endParenthesizedExpression(()
                     ensureSemicolon())
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/issue51415.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/issue51415.dart.intertwined.expect
index f73acd4..59902a5 100644
--- a/pkg/front_end/parser_testcases/patterns/issue51415.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/issue51415.dart.intertwined.expect
@@ -25,7 +25,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -41,7 +41,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(obj, expression)
                                 listener: handleNoTypeArguments(case)
@@ -102,16 +101,16 @@
                     parseBlock(), BlockKind(statement))
                       ensureBlock(), BlockKind(statement))
                       listener: beginBlock({, BlockKind(statement))
-                      notEofOrValue(}, ;)
+                      notEofOrType(CLOSE_CURLY_BRACKET, ;)
                       parseStatement({)
                         parseStatementX({)
                           parseEmptyStatement({)
                             listener: handleEmptyStatement(;)
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlock(1, {, }, BlockKind(statement))
                 listener: endThenStatement({, })
                 listener: endIfStatement(if, null, })
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement(})
             parseStatementX(})
               parseIfStatement(})
@@ -127,7 +126,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(obj, expression)
                                 listener: handleNoTypeArguments(case)
@@ -153,7 +151,6 @@
                                         parsePrimary((, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                             parseSend((, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(()
                                               ensureIdentifier((, expression)
                                                 listener: handleIdentifier(element, expression)
                                               listener: handleNoTypeArguments(,)
@@ -169,7 +166,6 @@
                                         parsePrimary(,, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                             parseSend(,, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(,)
                                               ensureIdentifier(,, expression)
                                                 listener: handleIdentifier(element, expression)
                                               listener: handleNoTypeArguments(,)
@@ -185,7 +181,6 @@
                                         parsePrimary(,, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                             parseSend(,, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(,)
                                               ensureIdentifier(,, expression)
                                                 listener: handleIdentifier(element, expression)
                                               listener: handleNoTypeArguments(,)
@@ -201,7 +196,6 @@
                                         parsePrimary(,, expression, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                             parseSend(,, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(,)
                                               ensureIdentifier(,, expression)
                                                 listener: handleIdentifier(element, expression)
                                               listener: handleNoTypeArguments())
@@ -220,16 +214,16 @@
                     parseBlock(), BlockKind(statement))
                       ensureBlock(), BlockKind(statement))
                       listener: beginBlock({, BlockKind(statement))
-                      notEofOrValue(}, ;)
+                      notEofOrType(CLOSE_CURLY_BRACKET, ;)
                       parseStatement({)
                         parseStatementX({)
                           parseEmptyStatement({)
                             listener: handleEmptyStatement(;)
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlock(1, {, }, BlockKind(statement))
                 listener: endThenStatement({, })
                 listener: endIfStatement(if, null, })
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement(})
             parseStatementX(})
               parseIfStatement(})
@@ -245,7 +239,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(obj, expression)
                                 listener: handleNoTypeArguments(case)
@@ -307,16 +300,16 @@
                     parseBlock(), BlockKind(statement))
                       ensureBlock(), BlockKind(statement))
                       listener: beginBlock({, BlockKind(statement))
-                      notEofOrValue(}, ;)
+                      notEofOrType(CLOSE_CURLY_BRACKET, ;)
                       parseStatement({)
                         parseStatementX({)
                           parseEmptyStatement({)
                             listener: handleEmptyStatement(;)
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlock(1, {, }, BlockKind(statement))
                 listener: endThenStatement({, })
                 listener: endIfStatement(if, null, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(3, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/issue_51169.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/issue_51169.dart.intertwined.expect
index 96a846b..d53aa19 100644
--- a/pkg/front_end/parser_testcases/patterns/issue_51169.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/issue_51169.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Class, DeclarationKind.Class, Class)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, dynamic)
+            notEofOrType(CLOSE_CURLY_BRACKET, dynamic)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Class)
               parseMetadataStar({)
                 listener: beginMetadataStar(dynamic)
@@ -42,7 +42,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, dynamic, ;)
               listener: endMember()
-            notEofOrValue(}, Class)
+            notEofOrType(CLOSE_CURLY_BRACKET, Class)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Class)
               parseMetadataStar(;)
                 listener: beginMetadataStar(Class)
@@ -82,7 +82,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, Class, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 2, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -120,7 +120,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -136,7 +136,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(a, expression)
                                 listener: handleNoTypeArguments())
@@ -148,7 +147,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -180,7 +179,6 @@
                         parsePrimary(when, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(when, expression, ConstantPatternContext.none)
                             parseSend(when, expression, ConstantPatternContext.none)
-                              isNextIdentifier(when)
                               ensureIdentifier(when, expression)
                                 listener: handleIdentifier(b, expression)
                               listener: handleNoTypeArguments(!=)
@@ -215,7 +213,6 @@
                                     parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                       looksLikeFunctionBody(;)
                                       parseSend(:, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(:)
                                         ensureIdentifier(:, expression)
                                           listener: handleIdentifier(print, expression)
                                         listener: handleNoTypeArguments(()
@@ -232,7 +229,6 @@
                                                     parsePrimary((, expression, ConstantPatternContext.none)
                                                       parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                         parseSend((, expression, ConstantPatternContext.none)
-                                                          isNextIdentifier(()
                                                           ensureIdentifier((, expression)
                                                             listener: handleIdentifier(b, expression)
                                                           listener: handleNoTypeArguments())
@@ -245,7 +241,7 @@
                             listener: handleExpressionStatement(print, ;)
                     peekPastLabels(case)
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -297,7 +293,6 @@
                         parsePrimary(when, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(when, expression, ConstantPatternContext.none)
                             parseSend(when, expression, ConstantPatternContext.none)
-                              isNextIdentifier(when)
                               ensureIdentifier(when, expression)
                                 listener: handleIdentifier(b, expression)
                               listener: handleNoTypeArguments(!=)
@@ -351,7 +346,6 @@
                                     parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                       looksLikeFunctionBody(;)
                                       parseSend(:, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(:)
                                         ensureIdentifier(:, expression)
                                           listener: handleIdentifier(print, expression)
                                         listener: handleNoTypeArguments(()
@@ -368,7 +362,6 @@
                                                     parsePrimary((, expression, ConstantPatternContext.none)
                                                       parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                         parseSend((, expression, ConstantPatternContext.none)
-                                                          isNextIdentifier(()
                                                           ensureIdentifier((, expression)
                                                             listener: handleIdentifier(b, expression)
                                                           listener: handleNoTypeArguments())
@@ -381,7 +374,7 @@
                             listener: handleExpressionStatement(print, ;)
                     peekPastLabels(case)
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -414,7 +407,6 @@
                         parsePrimary(when, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(when, expression, ConstantPatternContext.none)
                             parseSend(when, expression, ConstantPatternContext.none)
-                              isNextIdentifier(when)
                               ensureIdentifier(when, expression)
                                 listener: handleIdentifier(b, expression)
                               listener: handleNoTypeArguments(!=)
@@ -449,7 +441,6 @@
                                     parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                       looksLikeFunctionBody(;)
                                       parseSend(:, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(:)
                                         ensureIdentifier(:, expression)
                                           listener: handleIdentifier(print, expression)
                                         listener: handleNoTypeArguments(()
@@ -466,7 +457,6 @@
                                                     parsePrimary((, expression, ConstantPatternContext.none)
                                                       parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                         parseSend((, expression, ConstantPatternContext.none)
-                                                          isNextIdentifier(()
                                                           ensureIdentifier((, expression)
                                                             listener: handleIdentifier(b, expression)
                                                           listener: handleNoTypeArguments())
@@ -479,7 +469,7 @@
                             listener: handleExpressionStatement(print, ;)
                     peekPastLabels(case)
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -532,7 +522,6 @@
                         parsePrimary(when, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(when, expression, ConstantPatternContext.none)
                             parseSend(when, expression, ConstantPatternContext.none)
-                              isNextIdentifier(when)
                               ensureIdentifier(when, expression)
                                 listener: handleIdentifier(b, expression)
                               listener: handleNoTypeArguments(!=)
@@ -586,7 +575,6 @@
                                     parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                       looksLikeFunctionBody(;)
                                       parseSend(:, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(:)
                                         ensureIdentifier(:, expression)
                                           listener: handleIdentifier(print, expression)
                                         listener: handleNoTypeArguments(()
@@ -603,7 +591,6 @@
                                                     parsePrimary((, expression, ConstantPatternContext.none)
                                                       parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                         parseSend((, expression, ConstantPatternContext.none)
-                                                          isNextIdentifier(()
                                                           ensureIdentifier((, expression)
                                                             listener: handleIdentifier(b, expression)
                                                           listener: handleNoTypeArguments())
@@ -616,10 +603,10 @@
                             listener: handleExpressionStatement(print, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(4, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
@@ -657,7 +644,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -673,7 +660,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(a, expression)
                                 listener: handleNoTypeArguments())
@@ -685,7 +671,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -737,7 +723,6 @@
                         parsePrimary(when, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(when, expression, ConstantPatternContext.none)
                             parseSend(when, expression, ConstantPatternContext.none)
-                              isNextIdentifier(when)
                               ensureIdentifier(when, expression)
                                 listener: handleIdentifier(b, expression)
                               listener: handleNoTypeArguments(!=)
@@ -791,7 +776,6 @@
                                     parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                       looksLikeFunctionBody(;)
                                       parseSend(:, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(:)
                                         ensureIdentifier(:, expression)
                                           listener: handleIdentifier(print, expression)
                                         listener: handleNoTypeArguments(()
@@ -808,7 +792,6 @@
                                                     parsePrimary((, expression, ConstantPatternContext.none)
                                                       parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                         parseSend((, expression, ConstantPatternContext.none)
-                                                          isNextIdentifier(()
                                                           ensureIdentifier((, expression)
                                                             listener: handleIdentifier(b, expression)
                                                           listener: handleNoTypeArguments())
@@ -821,7 +804,7 @@
                             listener: handleExpressionStatement(print, ;)
                     peekPastLabels(case)
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -874,7 +857,6 @@
                         parsePrimary(when, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(when, expression, ConstantPatternContext.none)
                             parseSend(when, expression, ConstantPatternContext.none)
-                              isNextIdentifier(when)
                               ensureIdentifier(when, expression)
                                 listener: handleIdentifier(b, expression)
                               listener: handleNoTypeArguments(!=)
@@ -928,7 +910,6 @@
                                     parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                       looksLikeFunctionBody(;)
                                       parseSend(:, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(:)
                                         ensureIdentifier(:, expression)
                                           listener: handleIdentifier(print, expression)
                                         listener: handleNoTypeArguments(()
@@ -945,7 +926,6 @@
                                                     parsePrimary((, expression, ConstantPatternContext.none)
                                                       parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                         parseSend((, expression, ConstantPatternContext.none)
-                                                          isNextIdentifier(()
                                                           ensureIdentifier((, expression)
                                                             listener: handleIdentifier(b, expression)
                                                           listener: handleNoTypeArguments())
@@ -958,10 +938,10 @@
                             listener: handleExpressionStatement(print, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(2, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(testNullable, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/issue_51176.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/issue_51176.dart.intertwined.expect
index 40da972..33cc18e 100644
--- a/pkg/front_end/parser_testcases/patterns/issue_51176.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/issue_51176.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
@@ -92,7 +92,7 @@
                               listener: endRecordLiteral((, 1, null)
                   ensureSemicolon())
                   listener: handlePatternVariableDeclarationStatement(var, =, ;)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(var, ;, null, var, null, null)
@@ -165,7 +165,7 @@
                               listener: endRecordLiteral((, 1, null)
                   ensureSemicolon())
                   listener: handlePatternVariableDeclarationStatement(var, =, ;)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(var, ;, null, var, null, null)
@@ -313,7 +313,7 @@
                               listener: endRecordLiteral((, 2, null)
                   ensureSemicolon())
                   listener: handlePatternVariableDeclarationStatement(var, =, ;)
-          notEofOrValue(}, final)
+          notEofOrType(CLOSE_CURLY_BRACKET, final)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(final, ;, null, final, null, null)
@@ -379,7 +379,7 @@
                               listener: endRecordLiteral((, 1, null)
                   ensureSemicolon())
                   listener: handlePatternVariableDeclarationStatement(final, =, ;)
-          notEofOrValue(}, final)
+          notEofOrType(CLOSE_CURLY_BRACKET, final)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(final, ;, null, final, null, null)
@@ -452,7 +452,7 @@
                               listener: endRecordLiteral((, 1, null)
                   ensureSemicolon())
                   listener: handlePatternVariableDeclarationStatement(final, =, ;)
-          notEofOrValue(}, final)
+          notEofOrType(CLOSE_CURLY_BRACKET, final)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(final, ;, null, final, null, null)
@@ -600,7 +600,7 @@
                               listener: endRecordLiteral((, 2, null)
                   ensureSemicolon())
                   listener: handlePatternVariableDeclarationStatement(final, =, ;)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(var, ;, null, var, null, null)
@@ -668,7 +668,7 @@
                               listener: endRecordLiteral((, 1, null)
                   ensureSemicolon())
                   listener: handlePatternVariableDeclarationStatement(var, =, ;)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(var, ;, null, var, null, null)
@@ -743,7 +743,7 @@
                               listener: endRecordLiteral((, 1, null)
                   ensureSemicolon())
                   listener: handlePatternVariableDeclarationStatement(var, =, ;)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(var, ;, null, var, null, null)
@@ -899,7 +899,7 @@
                               listener: endRecordLiteral((, 2, null)
                   ensureSemicolon())
                   listener: handlePatternVariableDeclarationStatement(var, =, ;)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(var, ;, null, var, null, null)
@@ -1066,7 +1066,7 @@
                               listener: endRecordLiteral((, 2, null)
                   ensureSemicolon())
                   listener: handlePatternVariableDeclarationStatement(var, =, ;)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(var, ;, null, var, null, null)
@@ -1119,7 +1119,7 @@
                               listener: endRecordLiteral((, 1, null)
                   ensureSemicolon())
                   listener: handlePatternVariableDeclarationStatement(var, =, ;)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(var, ;, null, var, null, null)
@@ -1179,7 +1179,7 @@
                               listener: endRecordLiteral((, 1, null)
                   ensureSemicolon())
                   listener: handlePatternVariableDeclarationStatement(var, =, ;)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(var, ;, null, var, null, null)
@@ -1282,7 +1282,7 @@
                               listener: endRecordLiteral((, 2, null)
                   ensureSemicolon())
                   listener: handlePatternVariableDeclarationStatement(var, =, ;)
-          notEofOrValue(}, final)
+          notEofOrType(CLOSE_CURLY_BRACKET, final)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(final, ;, null, final, null, null)
@@ -1335,7 +1335,7 @@
                               listener: endRecordLiteral((, 1, null)
                   ensureSemicolon())
                   listener: handlePatternVariableDeclarationStatement(final, =, ;)
-          notEofOrValue(}, final)
+          notEofOrType(CLOSE_CURLY_BRACKET, final)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(final, ;, null, final, null, null)
@@ -1395,7 +1395,7 @@
                               listener: endRecordLiteral((, 1, null)
                   ensureSemicolon())
                   listener: handlePatternVariableDeclarationStatement(final, =, ;)
-          notEofOrValue(}, final)
+          notEofOrType(CLOSE_CURLY_BRACKET, final)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(final, ;, null, final, null, null)
@@ -1498,7 +1498,7 @@
                               listener: endRecordLiteral((, 2, null)
                   ensureSemicolon())
                   listener: handlePatternVariableDeclarationStatement(final, =, ;)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(var, ;, null, var, null, null)
@@ -1553,7 +1553,7 @@
                               listener: endRecordLiteral((, 1, null)
                   ensureSemicolon())
                   listener: handlePatternVariableDeclarationStatement(var, =, ;)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(var, ;, null, var, null, null)
@@ -1615,7 +1615,7 @@
                               listener: endRecordLiteral((, 1, null)
                   ensureSemicolon())
                   listener: handlePatternVariableDeclarationStatement(var, =, ;)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(var, ;, null, var, null, null)
@@ -1726,7 +1726,7 @@
                               listener: endRecordLiteral((, 2, null)
                   ensureSemicolon())
                   listener: handlePatternVariableDeclarationStatement(var, =, ;)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(var, ;, null, var, null, null)
@@ -1846,7 +1846,7 @@
                               listener: endRecordLiteral((, 2, null)
                   ensureSemicolon())
                   listener: handlePatternVariableDeclarationStatement(var, =, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(20, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/issue_51230.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/issue_51230.dart.intertwined.expect
index a299577..1b1078b 100644
--- a/pkg/front_end/parser_testcases/patterns/issue_51230.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/issue_51230.dart.intertwined.expect
@@ -56,7 +56,6 @@
                                 parsePrimary((, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                     parseSend((, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(()
                                       ensureIdentifier((, expression)
                                         listener: handleIdentifier(o, expression)
                                       listener: handleNoTypeArguments())
@@ -613,7 +612,6 @@
                                 parsePrimary((, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                     parseSend((, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(()
                                       ensureIdentifier((, expression)
                                         listener: handleIdentifier(o, expression)
                                       listener: handleNoTypeArguments())
@@ -1139,7 +1137,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -1176,7 +1174,6 @@
                                               parseSendOrFunctionLiteral(=>, expression, ConstantPatternContext.none)
                                                 looksLikeFunctionBody(;)
                                                 parseSend(=>, expression, ConstantPatternContext.none)
-                                                  isNextIdentifier(=>)
                                                   ensureIdentifier(=>, expression)
                                                     listener: handleIdentifier(print, expression)
                                                   listener: handleNoTypeArguments(()
@@ -1201,7 +1198,7 @@
                                 listener: endFunctionExpression((, ))
                     ensureSemicolon())
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1250,7 +1247,6 @@
                                               parseSendOrFunctionLiteral(=>, expression, ConstantPatternContext.none)
                                                 looksLikeFunctionBody(;)
                                                 parseSend(=>, expression, ConstantPatternContext.none)
-                                                  isNextIdentifier(=>)
                                                   ensureIdentifier(=>, expression)
                                                     listener: handleIdentifier(print, expression)
                                                   listener: handleNoTypeArguments(()
@@ -1275,7 +1271,7 @@
                                 listener: endFunctionExpression((, ))
                     ensureSemicolon())
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1336,7 +1332,6 @@
                                               parseSendOrFunctionLiteral(=>, expression, ConstantPatternContext.none)
                                                 looksLikeFunctionBody(;)
                                                 parseSend(=>, expression, ConstantPatternContext.none)
-                                                  isNextIdentifier(=>)
                                                   ensureIdentifier(=>, expression)
                                                     listener: handleIdentifier(print, expression)
                                                   listener: handleNoTypeArguments(()
@@ -1361,7 +1356,7 @@
                                 listener: endFunctionExpression((, ))
                     ensureSemicolon())
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(3, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/issue_52439.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/issue_52439.dart.intertwined.expect
index e961ec4..87264a8 100644
--- a/pkg/front_end/parser_testcases/patterns/issue_52439.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/issue_52439.dart.intertwined.expect
@@ -25,7 +25,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
@@ -90,7 +90,6 @@
                                       parsePrimary((, expression, ConstantPatternContext.none)
                                         parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                           parseSend((, expression, ConstantPatternContext.none)
-                                            isNextIdentifier(()
                                             ensureIdentifier((, expression)
                                               listener: handleIdentifier(foo, expression)
                                             listener: handleNoTypeArguments())
@@ -143,7 +142,7 @@
                             listener: endSwitchExpression(switch, })
                   ensureSemicolon(})
                   listener: handlePatternVariableDeclarationStatement(var, =, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/issue_52954.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/issue_52954.dart.intertwined.expect
index 3d8db22..e3eabfa 100644
--- a/pkg/front_end/parser_testcases/patterns/issue_52954.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/issue_52954.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, final)
+          notEofOrType(CLOSE_CURLY_BRACKET, final)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(final, {, null, final, null, null)
@@ -100,7 +100,7 @@
                     listener: endInitializedIdentifier(record)
                   ensureSemicolon())
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, final)
+          notEofOrType(CLOSE_CURLY_BRACKET, final)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(final, ;, null, final, null, null)
@@ -158,7 +158,6 @@
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               ensureIdentifier(=, expression)
                                 listener: handleIdentifier(record, expression)
                               listener: handleNoTypeArguments(;)
@@ -167,7 +166,7 @@
                               listener: handleSend(record, record)
                   ensureSemicolon(record)
                   listener: handlePatternVariableDeclarationStatement(final, =, ;)
-          notEofOrValue(}, print)
+          notEofOrType(CLOSE_CURLY_BRACKET, print)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -183,7 +182,6 @@
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(print, expression)
                               listener: handleNoTypeArguments(()
@@ -202,7 +200,6 @@
                                                 listener: beginLiteralString("a = )
                                                 parseIdentifierExpression($)
                                                   parseSend($, expression, ConstantPatternContext.none)
-                                                    isNextIdentifier($)
                                                     ensureIdentifier($, expression)
                                                       listener: handleIdentifier(a, expression)
                                                     listener: handleNoTypeArguments(; b = )
@@ -214,7 +211,6 @@
                                                   listener: handleStringPart(; b = )
                                                 parseIdentifierExpression($)
                                                   parseSend($, expression, ConstantPatternContext.none)
-                                                    isNextIdentifier($)
                                                     ensureIdentifier($, expression)
                                                       listener: handleIdentifier(b, expression)
                                                     listener: handleNoTypeArguments(, c = )
@@ -226,7 +222,6 @@
                                                   listener: handleStringPart(, c = )
                                                 parseIdentifierExpression($)
                                                   parseSend($, expression, ConstantPatternContext.none)
-                                                    isNextIdentifier($)
                                                     ensureIdentifier($, expression)
                                                       listener: handleIdentifier(c, expression)
                                                     listener: handleNoTypeArguments(")
@@ -241,7 +236,7 @@
                               listener: handleSend(print, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(print, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(3, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/issue_52954_prime.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/issue_52954_prime.dart.intertwined.expect
index d346948..a87ed1d 100644
--- a/pkg/front_end/parser_testcases/patterns/issue_52954_prime.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/issue_52954_prime.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, final)
+          notEofOrType(CLOSE_CURLY_BRACKET, final)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(final, {, null, final, null, null)
@@ -100,7 +100,7 @@
                     listener: endInitializedIdentifier(record)
                   ensureSemicolon())
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, final)
+          notEofOrType(CLOSE_CURLY_BRACKET, final)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(final, ;, null, final, null, null)
@@ -159,7 +159,6 @@
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               ensureIdentifier(=, expression)
                                 listener: handleIdentifier(record, expression)
                               listener: handleNoTypeArguments(;)
@@ -168,7 +167,7 @@
                               listener: handleSend(record, record)
                   ensureSemicolon(record)
                   listener: handlePatternVariableDeclarationStatement(final, =, ;)
-          notEofOrValue(}, print)
+          notEofOrType(CLOSE_CURLY_BRACKET, print)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -184,7 +183,6 @@
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(print, expression)
                               listener: handleNoTypeArguments(()
@@ -203,7 +201,6 @@
                                                 listener: beginLiteralString("a = )
                                                 parseIdentifierExpression($)
                                                   parseSend($, expression, ConstantPatternContext.none)
-                                                    isNextIdentifier($)
                                                     ensureIdentifier($, expression)
                                                       listener: handleIdentifier(a, expression)
                                                     listener: handleNoTypeArguments(; b = )
@@ -215,7 +212,6 @@
                                                   listener: handleStringPart(; b = )
                                                 parseIdentifierExpression($)
                                                   parseSend($, expression, ConstantPatternContext.none)
-                                                    isNextIdentifier($)
                                                     ensureIdentifier($, expression)
                                                       listener: handleIdentifier(b, expression)
                                                     listener: handleNoTypeArguments(, c = )
@@ -227,7 +223,6 @@
                                                   listener: handleStringPart(, c = )
                                                 parseIdentifierExpression($)
                                                   parseSend($, expression, ConstantPatternContext.none)
-                                                    isNextIdentifier($)
                                                     ensureIdentifier($, expression)
                                                       listener: handleIdentifier(c, expression)
                                                     listener: handleNoTypeArguments(")
@@ -242,7 +237,7 @@
                               listener: handleSend(print, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(print, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(3, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/list_insideAssignment_typed_nonEmpty.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/list_insideAssignment_typed_nonEmpty.dart.intertwined.expect
index 9882cc2..6297cea 100644
--- a/pkg/front_end/parser_testcases/patterns/list_insideAssignment_typed_nonEmpty.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/list_insideAssignment_typed_nonEmpty.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, <)
+          notEofOrType(CLOSE_CURLY_BRACKET, <)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -78,7 +78,6 @@
                               parsePrimary(=, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                   parseSend(=, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(=)
                                     ensureIdentifier(=, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(;)
@@ -88,7 +87,7 @@
                         listener: handlePatternAssignment(=)
                     ensureSemicolon(x)
                     listener: handleExpressionStatement(<, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/list_insideAssignment_untyped_empty.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/list_insideAssignment_untyped_empty.dart.intertwined.expect
index c6ef533..772924d 100644
--- a/pkg/front_end/parser_testcases/patterns/list_insideAssignment_untyped_empty.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/list_insideAssignment_untyped_empty.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, [])
+          notEofOrType(CLOSE_CURLY_BRACKET, [])
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -65,7 +65,6 @@
                               parsePrimary(=, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                   parseSend(=, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(=)
                                     ensureIdentifier(=, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(;)
@@ -75,7 +74,7 @@
                         listener: handlePatternAssignment(=)
                     ensureSemicolon(x)
                     listener: handleExpressionStatement([], ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/list_insideAssignment_untyped_emptyWithWhitespace.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/list_insideAssignment_untyped_emptyWithWhitespace.dart.intertwined.expect
index 07647b8..ef20963 100644
--- a/pkg/front_end/parser_testcases/patterns/list_insideAssignment_untyped_emptyWithWhitespace.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/list_insideAssignment_untyped_emptyWithWhitespace.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, [)
+          notEofOrType(CLOSE_CURLY_BRACKET, [)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -62,7 +62,6 @@
                               parsePrimary(=, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                   parseSend(=, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(=)
                                     ensureIdentifier(=, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(;)
@@ -72,7 +71,7 @@
                         listener: handlePatternAssignment(=)
                     ensureSemicolon(x)
                     listener: handleExpressionStatement([, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/list_insideAssignment_untyped_nonEmpty.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/list_insideAssignment_untyped_nonEmpty.dart.intertwined.expect
index e63bd72..5a8c9bb 100644
--- a/pkg/front_end/parser_testcases/patterns/list_insideAssignment_untyped_nonEmpty.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/list_insideAssignment_untyped_nonEmpty.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, [)
+          notEofOrType(CLOSE_CURLY_BRACKET, [)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -74,7 +74,6 @@
                               parsePrimary(=, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                   parseSend(=, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(=)
                                     ensureIdentifier(=, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(;)
@@ -84,7 +83,7 @@
                         listener: handlePatternAssignment(=)
                     ensureSemicolon(x)
                     listener: handleExpressionStatement([, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/list_insideDeclaration_typed_nonEmpty.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/list_insideDeclaration_typed_nonEmpty.dart.intertwined.expect
index a405f74..53ebad3 100644
--- a/pkg/front_end/parser_testcases/patterns/list_insideDeclaration_typed_nonEmpty.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/list_insideDeclaration_typed_nonEmpty.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
@@ -77,7 +77,6 @@
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               ensureIdentifier(=, expression)
                                 listener: handleIdentifier(x, expression)
                               listener: handleNoTypeArguments(;)
@@ -86,7 +85,7 @@
                               listener: handleSend(x, x)
                   ensureSemicolon(x)
                   listener: handlePatternVariableDeclarationStatement(var, =, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/list_insideDeclaration_untyped_empty.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/list_insideDeclaration_untyped_empty.dart.intertwined.expect
index 70d28c6..63244a9 100644
--- a/pkg/front_end/parser_testcases/patterns/list_insideDeclaration_untyped_empty.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/list_insideDeclaration_untyped_empty.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
@@ -62,7 +62,6 @@
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               ensureIdentifier(=, expression)
                                 listener: handleIdentifier(x, expression)
                               listener: handleNoTypeArguments(;)
@@ -71,7 +70,7 @@
                               listener: handleSend(x, x)
                   ensureSemicolon(x)
                   listener: handlePatternVariableDeclarationStatement(var, =, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/list_insideDeclaration_untyped_emptyWithWhitespace.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/list_insideDeclaration_untyped_emptyWithWhitespace.dart.intertwined.expect
index 6e59cb2..be556b5 100644
--- a/pkg/front_end/parser_testcases/patterns/list_insideDeclaration_untyped_emptyWithWhitespace.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/list_insideDeclaration_untyped_emptyWithWhitespace.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
@@ -59,7 +59,6 @@
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               ensureIdentifier(=, expression)
                                 listener: handleIdentifier(x, expression)
                               listener: handleNoTypeArguments(;)
@@ -68,7 +67,7 @@
                               listener: handleSend(x, x)
                   ensureSemicolon(x)
                   listener: handlePatternVariableDeclarationStatement(var, =, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/list_insideDeclaration_untyped_nonEmpty.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/list_insideDeclaration_untyped_nonEmpty.dart.intertwined.expect
index 6764685..bc49c78 100644
--- a/pkg/front_end/parser_testcases/patterns/list_insideDeclaration_untyped_nonEmpty.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/list_insideDeclaration_untyped_nonEmpty.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
@@ -73,7 +73,6 @@
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               ensureIdentifier(=, expression)
                                 listener: handleIdentifier(x, expression)
                               listener: handleNoTypeArguments(;)
@@ -82,7 +81,7 @@
                               listener: handleSend(x, x)
                   ensureSemicolon(x)
                   listener: handlePatternVariableDeclarationStatement(var, =, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/list_pattern_inside_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/list_pattern_inside_case.dart.intertwined.expect
index 251ce62..2e79540 100644
--- a/pkg/front_end/parser_testcases/patterns/list_pattern_inside_case.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/list_pattern_inside_case.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -112,10 +111,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/list_pattern_inside_case_empty.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/list_pattern_inside_case_empty.dart.intertwined.expect
index ee56070..8435c19 100644
--- a/pkg/front_end/parser_testcases/patterns/list_pattern_inside_case_empty.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/list_pattern_inside_case_empty.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -93,10 +92,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/list_pattern_inside_case_empty_whitespace.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/list_pattern_inside_case_empty_whitespace.dart.intertwined.expect
index ca3dc54..6e88c9f 100644
--- a/pkg/front_end/parser_testcases/patterns/list_pattern_inside_case_empty_whitespace.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/list_pattern_inside_case_empty_whitespace.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -90,10 +89,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/list_pattern_inside_case_with_type_arguments.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/list_pattern_inside_case_with_type_arguments.dart.intertwined.expect
index 478e3cd..5b166ce 100644
--- a/pkg/front_end/parser_testcases/patterns/list_pattern_inside_case_with_type_arguments.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/list_pattern_inside_case_with_type_arguments.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -116,10 +115,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/list_pattern_inside_cast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/list_pattern_inside_cast.dart.intertwined.expect
index e230c0b..e71a3510 100644
--- a/pkg/front_end/parser_testcases/patterns/list_pattern_inside_cast.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/list_pattern_inside_cast.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -108,10 +107,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/list_pattern_inside_null_assert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/list_pattern_inside_null_assert.dart.intertwined.expect
index 9a32a11..ca5fc4e 100644
--- a/pkg/front_end/parser_testcases/patterns/list_pattern_inside_null_assert.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/list_pattern_inside_null_assert.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -102,10 +101,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/list_pattern_inside_null_check.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/list_pattern_inside_null_check.dart.intertwined.expect
index 61b80b0..4a988fe 100644
--- a/pkg/front_end/parser_testcases/patterns/list_pattern_inside_null_check.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/list_pattern_inside_null_check.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -102,10 +101,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/list_recovery_bogusTokensAfterListElement.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/list_recovery_bogusTokensAfterListElement.dart.intertwined.expect
index 4efc49a..ddf36ba 100644
--- a/pkg/front_end/parser_testcases/patterns/list_recovery_bogusTokensAfterListElement.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/list_recovery_bogusTokensAfterListElement.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -97,10 +96,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/list_recovery_missingClosingBracket.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/list_recovery_missingClosingBracket.dart.intertwined.expect
index 7da1bee..a574e95 100644
--- a/pkg/front_end/parser_testcases/patterns/list_recovery_missingClosingBracket.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/list_recovery_missingClosingBracket.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -96,10 +95,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/list_recovery_missingComma.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/list_recovery_missingComma.dart.intertwined.expect
index 78b6797..d49d5ef 100644
--- a/pkg/front_end/parser_testcases/patterns/list_recovery_missingComma.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/list_recovery_missingComma.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -107,10 +106,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/logical_and_inside_if_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/logical_and_inside_if_case.dart.intertwined.expect
index 2275987..fb7fe15 100644
--- a/pkg/front_end/parser_testcases/patterns/logical_and_inside_if_case.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/logical_and_inside_if_case.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(case)
@@ -89,11 +88,11 @@
                     parseBlock(), BlockKind(statement))
                       ensureBlock(), BlockKind(statement))
                       listener: beginBlock({, BlockKind(statement))
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlock(0, {, }, BlockKind(statement))
                 listener: endThenStatement({, })
                 listener: endIfStatement(if, null, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/logical_and_inside_logical_and_lhs.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/logical_and_inside_logical_and_lhs.dart.intertwined.expect
index 3261d36..998bcab 100644
--- a/pkg/front_end/parser_testcases/patterns/logical_and_inside_logical_and_lhs.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/logical_and_inside_logical_and_lhs.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -114,10 +113,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/logical_and_inside_logical_or_lhs.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/logical_and_inside_logical_or_lhs.dart.intertwined.expect
index 319cb9c..e9ac655 100644
--- a/pkg/front_end/parser_testcases/patterns/logical_and_inside_logical_or_lhs.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/logical_and_inside_logical_or_lhs.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -114,10 +113,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/logical_and_inside_logical_or_rhs.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/logical_and_inside_logical_or_rhs.dart.intertwined.expect
index be277f7..6b11711 100644
--- a/pkg/front_end/parser_testcases/patterns/logical_and_inside_logical_or_rhs.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/logical_and_inside_logical_or_rhs.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -114,10 +113,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/logical_or_inside_if_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/logical_or_inside_if_case.dart.intertwined.expect
index 9b890a7..cef5391 100644
--- a/pkg/front_end/parser_testcases/patterns/logical_or_inside_if_case.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/logical_or_inside_if_case.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(case)
@@ -89,11 +88,11 @@
                     parseBlock(), BlockKind(statement))
                       ensureBlock(), BlockKind(statement))
                       listener: beginBlock({, BlockKind(statement))
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlock(0, {, }, BlockKind(statement))
                 listener: endThenStatement({, })
                 listener: endIfStatement(if, null, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/logical_or_inside_logical_or_lhs.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/logical_or_inside_logical_or_lhs.dart.intertwined.expect
index f38afed..de353dd 100644
--- a/pkg/front_end/parser_testcases/patterns/logical_or_inside_logical_or_lhs.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/logical_or_inside_logical_or_lhs.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -114,10 +113,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/map_insideAssignment_typed_nonEmpty.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/map_insideAssignment_typed_nonEmpty.dart.intertwined.expect
index e882d54..89f4a98 100644
--- a/pkg/front_end/parser_testcases/patterns/map_insideAssignment_typed_nonEmpty.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/map_insideAssignment_typed_nonEmpty.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, <)
+          notEofOrType(CLOSE_CURLY_BRACKET, <)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -103,7 +103,6 @@
                               parsePrimary(=, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                   parseSend(=, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(=)
                                     ensureIdentifier(=, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(;)
@@ -113,7 +112,7 @@
                         listener: handlePatternAssignment(=)
                     ensureSemicolon(x)
                     listener: handleExpressionStatement(<, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/map_insideAssignment_untyped_empty.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/map_insideAssignment_untyped_empty.dart.intertwined.expect
index 085d9da..57d5ff1 100644
--- a/pkg/front_end/parser_testcases/patterns/map_insideAssignment_untyped_empty.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/map_insideAssignment_untyped_empty.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -71,7 +71,6 @@
                                           parsePrimary(=, expression, ConstantPatternContext.none)
                                             parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                               parseSend(=, expression, ConstantPatternContext.none)
-                                                isNextIdentifier(=)
                                                 ensureIdentifier(=, expression)
                                                   listener: handleIdentifier(x, expression)
                                                 listener: handleNoTypeArguments())
@@ -83,7 +82,7 @@
                                 listener: endParenthesizedExpression(()
                     ensureSemicolon())
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/map_insideAssignment_untyped_empty_beginningOfStatement.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/map_insideAssignment_untyped_empty_beginningOfStatement.dart.intertwined.expect
index 5a729ba..d7357e6 100644
--- a/pkg/front_end/parser_testcases/patterns/map_insideAssignment_untyped_empty_beginningOfStatement.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/map_insideAssignment_untyped_empty_beginningOfStatement.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, {)
+          notEofOrType(CLOSE_CURLY_BRACKET, {)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatement({)
@@ -59,7 +59,6 @@
                           parsePrimary(=, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                               parseSend(=, expression, ConstantPatternContext.none)
-                                isNextIdentifier(=)
                                 ensureIdentifier(=, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(;)
@@ -69,7 +68,7 @@
                     listener: handlePatternAssignment(=)
                 ensureSemicolon(x)
                 listener: handleExpressionStatement({, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/map_insideAssignment_untyped_nonEmpty.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/map_insideAssignment_untyped_nonEmpty.dart.intertwined.expect
index 6c9803f..558ae44 100644
--- a/pkg/front_end/parser_testcases/patterns/map_insideAssignment_untyped_nonEmpty.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/map_insideAssignment_untyped_nonEmpty.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -105,7 +105,6 @@
                                           parsePrimary(=, expression, ConstantPatternContext.none)
                                             parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                               parseSend(=, expression, ConstantPatternContext.none)
-                                                isNextIdentifier(=)
                                                 ensureIdentifier(=, expression)
                                                   listener: handleIdentifier(x, expression)
                                                 listener: handleNoTypeArguments())
@@ -117,7 +116,7 @@
                                 listener: endParenthesizedExpression(()
                     ensureSemicolon())
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/map_insideAssignment_untyped_nonEmpty_beginningOfStatement.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/map_insideAssignment_untyped_nonEmpty_beginningOfStatement.dart.intertwined.expect
index cac4435..09cad46 100644
--- a/pkg/front_end/parser_testcases/patterns/map_insideAssignment_untyped_nonEmpty_beginningOfStatement.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/map_insideAssignment_untyped_nonEmpty_beginningOfStatement.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, {)
+          notEofOrType(CLOSE_CURLY_BRACKET, {)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatement({)
@@ -93,7 +93,6 @@
                           parsePrimary(=, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                               parseSend(=, expression, ConstantPatternContext.none)
-                                isNextIdentifier(=)
                                 ensureIdentifier(=, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(;)
@@ -103,7 +102,7 @@
                     listener: handlePatternAssignment(=)
                 ensureSemicolon(x)
                 listener: handleExpressionStatement({, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/map_insideDeclaration_typed_nonEmpty.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/map_insideDeclaration_typed_nonEmpty.dart.intertwined.expect
index 4ef300d..5b486f7 100644
--- a/pkg/front_end/parser_testcases/patterns/map_insideDeclaration_typed_nonEmpty.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/map_insideDeclaration_typed_nonEmpty.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
@@ -102,7 +102,6 @@
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               ensureIdentifier(=, expression)
                                 listener: handleIdentifier(x, expression)
                               listener: handleNoTypeArguments(;)
@@ -111,7 +110,7 @@
                               listener: handleSend(x, x)
                   ensureSemicolon(x)
                   listener: handlePatternVariableDeclarationStatement(var, =, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/map_insideDeclaration_untyped_empty.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/map_insideDeclaration_untyped_empty.dart.intertwined.expect
index a548553..922b787 100644
--- a/pkg/front_end/parser_testcases/patterns/map_insideDeclaration_untyped_empty.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/map_insideDeclaration_untyped_empty.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
@@ -59,7 +59,6 @@
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               ensureIdentifier(=, expression)
                                 listener: handleIdentifier(x, expression)
                               listener: handleNoTypeArguments(;)
@@ -68,7 +67,7 @@
                               listener: handleSend(x, x)
                   ensureSemicolon(x)
                   listener: handlePatternVariableDeclarationStatement(var, =, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/map_insideDeclaration_untyped_nonEmpty.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/map_insideDeclaration_untyped_nonEmpty.dart.intertwined.expect
index 4199af9..448a697 100644
--- a/pkg/front_end/parser_testcases/patterns/map_insideDeclaration_untyped_nonEmpty.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/map_insideDeclaration_untyped_nonEmpty.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
@@ -95,7 +95,6 @@
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               ensureIdentifier(=, expression)
                                 listener: handleIdentifier(x, expression)
                               listener: handleNoTypeArguments(;)
@@ -104,7 +103,7 @@
                               listener: handleSend(x, x)
                   ensureSemicolon(x)
                   listener: handlePatternVariableDeclarationStatement(var, =, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/map_pattern_inside_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/map_pattern_inside_case.dart.intertwined.expect
index b98e419..4fb0a9c 100644
--- a/pkg/front_end/parser_testcases/patterns/map_pattern_inside_case.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/map_pattern_inside_case.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -134,10 +133,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/map_pattern_inside_case_empty.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/map_pattern_inside_case_empty.dart.intertwined.expect
index ba083d28..0360263 100644
--- a/pkg/front_end/parser_testcases/patterns/map_pattern_inside_case_empty.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/map_pattern_inside_case_empty.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -90,10 +89,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/map_pattern_inside_case_with_type_arguments.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/map_pattern_inside_case_with_type_arguments.dart.intertwined.expect
index 1eb1abd..806387b 100644
--- a/pkg/front_end/parser_testcases/patterns/map_pattern_inside_case_with_type_arguments.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/map_pattern_inside_case_with_type_arguments.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -141,10 +140,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/map_pattern_inside_cast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/map_pattern_inside_cast.dart.intertwined.expect
index 612b392..38ad907 100644
--- a/pkg/front_end/parser_testcases/patterns/map_pattern_inside_cast.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/map_pattern_inside_cast.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -119,10 +118,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/map_pattern_inside_null_assert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/map_pattern_inside_null_assert.dart.intertwined.expect
index 238dc1a..4b7cfb0 100644
--- a/pkg/front_end/parser_testcases/patterns/map_pattern_inside_null_assert.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/map_pattern_inside_null_assert.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -113,10 +112,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/map_pattern_inside_null_check.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/map_pattern_inside_null_check.dart.intertwined.expect
index 931ac62..ec36364 100644
--- a/pkg/front_end/parser_testcases/patterns/map_pattern_inside_null_check.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/map_pattern_inside_null_check.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -113,10 +112,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/map_recovery_bogusTokensAfterMapElement.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/map_recovery_bogusTokensAfterMapElement.dart.intertwined.expect
index 2105187..c56b178 100644
--- a/pkg/front_end/parser_testcases/patterns/map_recovery_bogusTokensAfterMapElement.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/map_recovery_bogusTokensAfterMapElement.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -108,10 +107,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/map_recovery_missingClosingBrace.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/map_recovery_missingClosingBrace.dart.intertwined.expect
index 9972bc4..bbfa7bc 100644
--- a/pkg/front_end/parser_testcases/patterns/map_recovery_missingClosingBrace.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/map_recovery_missingClosingBrace.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -113,10 +112,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/map_recovery_missingComma.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/map_recovery_missingComma.dart.intertwined.expect
index f0797b2..7d33469 100644
--- a/pkg/front_end/parser_testcases/patterns/map_recovery_missingComma.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/map_recovery_missingComma.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -129,10 +128,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/nullAssert_insideCast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/nullAssert_insideCast.dart.intertwined.expect
index 44a0909..c8ffa89 100644
--- a/pkg/front_end/parser_testcases/patterns/nullAssert_insideCast.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/nullAssert_insideCast.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, const)
+          notEofOrType(CLOSE_CURLY_BRACKET, const)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrConstDeclaration({)
@@ -64,7 +64,7 @@
                       listener: endInitializedIdentifier(y)
                     ensureSemicolon(1)
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement(;)
             parseStatementX(;)
               parseSwitchStatement(;)
@@ -80,7 +80,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -92,7 +91,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -104,7 +103,6 @@
                           parsePrimary(case, expression, ConstantPatternContext.implicit)
                             parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.implicit)
                               parseSend(case, expression, ConstantPatternContext.implicit)
-                                isNextIdentifier(case)
                                 ensureIdentifier(case, expression)
                                   listener: handleIdentifier(y, expression)
                                 listener: handleNoTypeArguments(!)
@@ -137,10 +135,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/nullAssert_insideNullAssert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/nullAssert_insideNullAssert.dart.intertwined.expect
index c90e6cc..7ab7a6c 100644
--- a/pkg/front_end/parser_testcases/patterns/nullAssert_insideNullAssert.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/nullAssert_insideNullAssert.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, const)
+          notEofOrType(CLOSE_CURLY_BRACKET, const)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrConstDeclaration({)
@@ -64,7 +64,7 @@
                       listener: endInitializedIdentifier(y)
                     ensureSemicolon(1)
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement(;)
             parseStatementX(;)
               parseSwitchStatement(;)
@@ -80,7 +80,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -92,7 +91,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -104,7 +103,6 @@
                           parsePrimary(case, expression, ConstantPatternContext.implicit)
                             parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.implicit)
                               parseSend(case, expression, ConstantPatternContext.implicit)
-                                isNextIdentifier(case)
                                 ensureIdentifier(case, expression)
                                   listener: handleIdentifier(y, expression)
                                 listener: handleNoTypeArguments(!)
@@ -131,10 +129,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/nullAssert_insideNullCheck.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/nullAssert_insideNullCheck.dart.intertwined.expect
index b1178fc..5857e60 100644
--- a/pkg/front_end/parser_testcases/patterns/nullAssert_insideNullCheck.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/nullAssert_insideNullCheck.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, const)
+          notEofOrType(CLOSE_CURLY_BRACKET, const)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrConstDeclaration({)
@@ -64,7 +64,7 @@
                       listener: endInitializedIdentifier(y)
                     ensureSemicolon(1)
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement(;)
             parseStatementX(;)
               parseSwitchStatement(;)
@@ -80,7 +80,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -92,7 +91,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -104,7 +103,6 @@
                           parsePrimary(case, expression, ConstantPatternContext.implicit)
                             parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.implicit)
                               parseSend(case, expression, ConstantPatternContext.implicit)
-                                isNextIdentifier(case)
                                 ensureIdentifier(case, expression)
                                   listener: handleIdentifier(y, expression)
                                 listener: handleNoTypeArguments(!)
@@ -131,10 +129,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/nullCheck_insideCast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/nullCheck_insideCast.dart.intertwined.expect
index 5317b5b..c72aa16 100644
--- a/pkg/front_end/parser_testcases/patterns/nullCheck_insideCast.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/nullCheck_insideCast.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, const)
+          notEofOrType(CLOSE_CURLY_BRACKET, const)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrConstDeclaration({)
@@ -64,7 +64,7 @@
                       listener: endInitializedIdentifier(y)
                     ensureSemicolon(1)
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement(;)
             parseStatementX(;)
               parseSwitchStatement(;)
@@ -80,7 +80,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -92,7 +91,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -104,7 +103,6 @@
                           parsePrimary(case, expression, ConstantPatternContext.implicit)
                             parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.implicit)
                               parseSend(case, expression, ConstantPatternContext.implicit)
-                                isNextIdentifier(case)
                                 ensureIdentifier(case, expression)
                                   listener: handleIdentifier(y, expression)
                                 listener: handleNoTypeArguments(?)
@@ -137,10 +135,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/nullCheck_insideNullAssert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/nullCheck_insideNullAssert.dart.intertwined.expect
index 7e29bc2..4135f69 100644
--- a/pkg/front_end/parser_testcases/patterns/nullCheck_insideNullAssert.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/nullCheck_insideNullAssert.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, const)
+          notEofOrType(CLOSE_CURLY_BRACKET, const)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrConstDeclaration({)
@@ -64,7 +64,7 @@
                       listener: endInitializedIdentifier(y)
                     ensureSemicolon(1)
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement(;)
             parseStatementX(;)
               parseSwitchStatement(;)
@@ -80,7 +80,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -92,7 +91,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -104,7 +103,6 @@
                           parsePrimary(case, expression, ConstantPatternContext.implicit)
                             parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.implicit)
                               parseSend(case, expression, ConstantPatternContext.implicit)
-                                isNextIdentifier(case)
                                 ensureIdentifier(case, expression)
                                   listener: handleIdentifier(y, expression)
                                 listener: handleNoTypeArguments(?)
@@ -131,10 +129,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/nullCheck_insideNullCheck.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/nullCheck_insideNullCheck.dart.intertwined.expect
index bb4a1f4..ae0ec1e 100644
--- a/pkg/front_end/parser_testcases/patterns/nullCheck_insideNullCheck.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/nullCheck_insideNullCheck.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, const)
+          notEofOrType(CLOSE_CURLY_BRACKET, const)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrConstDeclaration({)
@@ -64,7 +64,7 @@
                       listener: endInitializedIdentifier(y)
                     ensureSemicolon(1)
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement(;)
             parseStatementX(;)
               parseSwitchStatement(;)
@@ -80,7 +80,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -92,7 +91,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -104,7 +103,6 @@
                           parsePrimary(case, expression, ConstantPatternContext.implicit)
                             parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.implicit)
                               parseSend(case, expression, ConstantPatternContext.implicit)
-                                isNextIdentifier(case)
                                 ensureIdentifier(case, expression)
                                   listener: handleIdentifier(y, expression)
                                 listener: handleNoTypeArguments(?)
@@ -131,10 +129,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/null_assert_inside_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_assert_inside_case.dart.intertwined.expect
index 5700ca39..e277279 100644
--- a/pkg/front_end/parser_testcases/patterns/null_assert_inside_case.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/null_assert_inside_case.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, const)
+          notEofOrType(CLOSE_CURLY_BRACKET, const)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrConstDeclaration({)
@@ -67,7 +67,7 @@
                       listener: endInitializedIdentifier(y)
                     ensureSemicolon(1)
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement(;)
             parseStatementX(;)
               parseSwitchStatement(;)
@@ -83,7 +83,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -95,7 +94,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -107,7 +106,6 @@
                           parsePrimary(case, expression, ConstantPatternContext.implicit)
                             parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.implicit)
                               parseSend(case, expression, ConstantPatternContext.implicit)
-                                isNextIdentifier(case)
                                 ensureIdentifier(case, expression)
                                   listener: handleIdentifier(y, expression)
                                 listener: handleNoTypeArguments(!)
@@ -131,10 +129,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/null_assert_inside_extractor_pattern.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_assert_inside_extractor_pattern.dart.intertwined.expect
index dbee6ab..a0443d6 100644
--- a/pkg/front_end/parser_testcases/patterns/null_assert_inside_extractor_pattern.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/null_assert_inside_extractor_pattern.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(C, DeclarationKind.Class, C)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, C)
               parseMetadataStar({)
                 listener: beginMetadataStar(int)
@@ -42,7 +42,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -82,7 +82,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -98,7 +98,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -110,7 +109,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -150,10 +149,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/null_assert_inside_extractor_pattern_implicitly_named.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_assert_inside_extractor_pattern_implicitly_named.dart.intertwined.expect
index fb5788f..124c5a7 100644
--- a/pkg/front_end/parser_testcases/patterns/null_assert_inside_extractor_pattern_implicitly_named.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/null_assert_inside_extractor_pattern_implicitly_named.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(C, DeclarationKind.Class, C)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, C)
               parseMetadataStar({)
                 listener: beginMetadataStar(int)
@@ -42,7 +42,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -82,7 +82,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -98,7 +98,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -110,7 +109,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -145,10 +144,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/null_assert_inside_if_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_assert_inside_if_case.dart.intertwined.expect
index d8d05d4..e117e00 100644
--- a/pkg/front_end/parser_testcases/patterns/null_assert_inside_if_case.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/null_assert_inside_if_case.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(case)
@@ -77,11 +76,11 @@
                     parseBlock(), BlockKind(statement))
                       ensureBlock(), BlockKind(statement))
                       listener: beginBlock({, BlockKind(statement))
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlock(0, {, }, BlockKind(statement))
                 listener: endThenStatement({, })
                 listener: endIfStatement(if, null, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/null_assert_inside_list_pattern.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_assert_inside_list_pattern.dart.intertwined.expect
index 8aa1d79..63d9557 100644
--- a/pkg/front_end/parser_testcases/patterns/null_assert_inside_list_pattern.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/null_assert_inside_list_pattern.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -102,10 +101,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/null_assert_inside_logical_and_lhs.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_assert_inside_logical_and_lhs.dart.intertwined.expect
index 3433d60..700c856 100644
--- a/pkg/front_end/parser_testcases/patterns/null_assert_inside_logical_and_lhs.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/null_assert_inside_logical_and_lhs.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -108,10 +107,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/null_assert_inside_logical_and_rhs.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_assert_inside_logical_and_rhs.dart.intertwined.expect
index 8560279..94cf8e4 100644
--- a/pkg/front_end/parser_testcases/patterns/null_assert_inside_logical_and_rhs.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/null_assert_inside_logical_and_rhs.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -108,10 +107,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/null_assert_inside_logical_or_lhs.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_assert_inside_logical_or_lhs.dart.intertwined.expect
index aea826d..cfa8940 100644
--- a/pkg/front_end/parser_testcases/patterns/null_assert_inside_logical_or_lhs.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/null_assert_inside_logical_or_lhs.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -108,10 +107,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/null_assert_inside_logical_or_rhs.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_assert_inside_logical_or_rhs.dart.intertwined.expect
index 9bd07ed..162c6ce 100644
--- a/pkg/front_end/parser_testcases/patterns/null_assert_inside_logical_or_rhs.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/null_assert_inside_logical_or_rhs.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -108,10 +107,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/null_assert_inside_map_pattern.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_assert_inside_map_pattern.dart.intertwined.expect
index cf4e864..30a269a 100644
--- a/pkg/front_end/parser_testcases/patterns/null_assert_inside_map_pattern.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/null_assert_inside_map_pattern.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -113,10 +112,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/null_assert_inside_parenthesized_pattern.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_assert_inside_parenthesized_pattern.dart.intertwined.expect
index 9bd61b1..3cc430e 100644
--- a/pkg/front_end/parser_testcases/patterns/null_assert_inside_parenthesized_pattern.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/null_assert_inside_parenthesized_pattern.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -102,10 +101,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/null_assert_inside_record_pattern_implicitly_named.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_assert_inside_record_pattern_implicitly_named.dart.intertwined.expect
index 2a93dcb..7b4a08e 100644
--- a/pkg/front_end/parser_testcases/patterns/null_assert_inside_record_pattern_implicitly_named.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/null_assert_inside_record_pattern_implicitly_named.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -112,10 +111,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/null_assert_inside_record_pattern_named.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_assert_inside_record_pattern_named.dart.intertwined.expect
index fe43ac0..3e04fff 100644
--- a/pkg/front_end/parser_testcases/patterns/null_assert_inside_record_pattern_named.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/null_assert_inside_record_pattern_named.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -117,10 +116,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/null_assert_inside_record_pattern_unnamed.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_assert_inside_record_pattern_unnamed.dart.intertwined.expect
index 9e4896a..22b8675 100644
--- a/pkg/front_end/parser_testcases/patterns/null_assert_inside_record_pattern_unnamed.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/null_assert_inside_record_pattern_unnamed.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -115,10 +114,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/null_check_inside_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_check_inside_case.dart.intertwined.expect
index 1b762b2..2db5efa 100644
--- a/pkg/front_end/parser_testcases/patterns/null_check_inside_case.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/null_check_inside_case.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, const)
+          notEofOrType(CLOSE_CURLY_BRACKET, const)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrConstDeclaration({)
@@ -67,7 +67,7 @@
                       listener: endInitializedIdentifier(y)
                     ensureSemicolon(1)
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement(;)
             parseStatementX(;)
               parseSwitchStatement(;)
@@ -83,7 +83,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -95,7 +94,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -107,7 +106,6 @@
                           parsePrimary(case, expression, ConstantPatternContext.implicit)
                             parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.implicit)
                               parseSend(case, expression, ConstantPatternContext.implicit)
-                                isNextIdentifier(case)
                                 ensureIdentifier(case, expression)
                                   listener: handleIdentifier(y, expression)
                                 listener: handleNoTypeArguments(?)
@@ -131,10 +129,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/null_check_inside_extractor_pattern.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_check_inside_extractor_pattern.dart.intertwined.expect
index 298f6bd..271e144 100644
--- a/pkg/front_end/parser_testcases/patterns/null_check_inside_extractor_pattern.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/null_check_inside_extractor_pattern.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(C, DeclarationKind.Class, C)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, C)
               parseMetadataStar({)
                 listener: beginMetadataStar(int)
@@ -42,7 +42,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -82,7 +82,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -98,7 +98,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -110,7 +109,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -150,10 +149,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/null_check_inside_extractor_pattern_implicitly_named.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_check_inside_extractor_pattern_implicitly_named.dart.intertwined.expect
index 84926b1..c1f63b5 100644
--- a/pkg/front_end/parser_testcases/patterns/null_check_inside_extractor_pattern_implicitly_named.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/null_check_inside_extractor_pattern_implicitly_named.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(C, DeclarationKind.Class, C)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, C)
               parseMetadataStar({)
                 listener: beginMetadataStar(int)
@@ -42,7 +42,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -82,7 +82,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -98,7 +98,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -110,7 +109,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -145,10 +144,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/null_check_inside_if_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_check_inside_if_case.dart.intertwined.expect
index f2e033d..92605c5 100644
--- a/pkg/front_end/parser_testcases/patterns/null_check_inside_if_case.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/null_check_inside_if_case.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(case)
@@ -77,11 +76,11 @@
                     parseBlock(), BlockKind(statement))
                       ensureBlock(), BlockKind(statement))
                       listener: beginBlock({, BlockKind(statement))
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlock(0, {, }, BlockKind(statement))
                 listener: endThenStatement({, })
                 listener: endIfStatement(if, null, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/null_check_inside_list_pattern.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_check_inside_list_pattern.dart.intertwined.expect
index afb90f7..e89c00c 100644
--- a/pkg/front_end/parser_testcases/patterns/null_check_inside_list_pattern.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/null_check_inside_list_pattern.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -102,10 +101,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/null_check_inside_logical_and_lhs.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_check_inside_logical_and_lhs.dart.intertwined.expect
index dfbfa1a..7444527 100644
--- a/pkg/front_end/parser_testcases/patterns/null_check_inside_logical_and_lhs.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/null_check_inside_logical_and_lhs.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -108,10 +107,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/null_check_inside_logical_and_rhs.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_check_inside_logical_and_rhs.dart.intertwined.expect
index c0e4cf0..65bf2423 100644
--- a/pkg/front_end/parser_testcases/patterns/null_check_inside_logical_and_rhs.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/null_check_inside_logical_and_rhs.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -108,10 +107,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/null_check_inside_logical_or_lhs.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_check_inside_logical_or_lhs.dart.intertwined.expect
index ab78e9e..d3de98a 100644
--- a/pkg/front_end/parser_testcases/patterns/null_check_inside_logical_or_lhs.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/null_check_inside_logical_or_lhs.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -108,10 +107,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/null_check_inside_logical_or_rhs.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_check_inside_logical_or_rhs.dart.intertwined.expect
index 0d0ba6f..0ad493b 100644
--- a/pkg/front_end/parser_testcases/patterns/null_check_inside_logical_or_rhs.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/null_check_inside_logical_or_rhs.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -108,10 +107,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/null_check_inside_map_pattern.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_check_inside_map_pattern.dart.intertwined.expect
index 11e3faf..740b4ae 100644
--- a/pkg/front_end/parser_testcases/patterns/null_check_inside_map_pattern.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/null_check_inside_map_pattern.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -113,10 +112,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/null_check_inside_parenthesized_pattern.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_check_inside_parenthesized_pattern.dart.intertwined.expect
index 2ef3383..dd5fc22 100644
--- a/pkg/front_end/parser_testcases/patterns/null_check_inside_parenthesized_pattern.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/null_check_inside_parenthesized_pattern.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -102,10 +101,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/null_check_inside_record_pattern_implicitly_named.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_check_inside_record_pattern_implicitly_named.dart.intertwined.expect
index a86bb4e..b9ba2b0 100644
--- a/pkg/front_end/parser_testcases/patterns/null_check_inside_record_pattern_implicitly_named.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/null_check_inside_record_pattern_implicitly_named.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -112,10 +111,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/null_check_inside_record_pattern_named.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_check_inside_record_pattern_named.dart.intertwined.expect
index 8e40040..4b10aa0 100644
--- a/pkg/front_end/parser_testcases/patterns/null_check_inside_record_pattern_named.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/null_check_inside_record_pattern_named.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -117,10 +116,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/null_check_inside_record_pattern_unnamed.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_check_inside_record_pattern_unnamed.dart.intertwined.expect
index 980da9b..4830125 100644
--- a/pkg/front_end/parser_testcases/patterns/null_check_inside_record_pattern_unnamed.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/null_check_inside_record_pattern_unnamed.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -115,10 +114,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/null_literal_inside_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_literal_inside_case.dart.intertwined.expect
index 502107f..55f2a4d 100644
--- a/pkg/front_end/parser_testcases/patterns/null_literal_inside_case.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/null_literal_inside_case.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -94,10 +93,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/null_literal_inside_cast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_literal_inside_cast.dart.intertwined.expect
index cff2d0f..2040b67 100644
--- a/pkg/front_end/parser_testcases/patterns/null_literal_inside_cast.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/null_literal_inside_cast.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -101,10 +100,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/null_literal_inside_if_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_literal_inside_if_case.dart.intertwined.expect
index 61c456a..62596ca6 100644
--- a/pkg/front_end/parser_testcases/patterns/null_literal_inside_if_case.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/null_literal_inside_if_case.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(case)
@@ -80,11 +79,11 @@
                     parseBlock(), BlockKind(statement))
                       ensureBlock(), BlockKind(statement))
                       listener: beginBlock({, BlockKind(statement))
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlock(0, {, }, BlockKind(statement))
                 listener: endThenStatement({, })
                 listener: endIfStatement(if, null, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/null_literal_inside_null_assert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_literal_inside_null_assert.dart.intertwined.expect
index 2303246..e42ae8b 100644
--- a/pkg/front_end/parser_testcases/patterns/null_literal_inside_null_assert.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/null_literal_inside_null_assert.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -95,10 +94,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/null_literal_inside_null_check.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_literal_inside_null_check.dart.intertwined.expect
index a89d3e7..fbc93c8 100644
--- a/pkg/front_end/parser_testcases/patterns/null_literal_inside_null_check.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/null_literal_inside_null_check.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -95,10 +94,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/object_dynamic.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/object_dynamic.dart.intertwined.expect
index 3f61208..2c19a76 100644
--- a/pkg/front_end/parser_testcases/patterns/object_dynamic.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/object_dynamic.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -88,10 +87,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/object_otherIdentifier_async.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/object_otherIdentifier_async.dart.intertwined.expect
index 3bb18df..050d72f 100644
--- a/pkg/front_end/parser_testcases/patterns/object_otherIdentifier_async.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/object_otherIdentifier_async.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
@@ -61,7 +61,6 @@
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               ensureIdentifier(=, expression)
                                 listener: handleIdentifier(x, expression)
                               listener: handleNoTypeArguments(;)
@@ -70,7 +69,7 @@
                               listener: handleSend(x, x)
                   ensureSemicolon(x)
                   listener: handlePatternVariableDeclarationStatement(var, =, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/object_otherIdentifier_await.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/object_otherIdentifier_await.dart.intertwined.expect
index ff7759d..66b4c40 100644
--- a/pkg/front_end/parser_testcases/patterns/object_otherIdentifier_await.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/object_otherIdentifier_await.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
@@ -61,7 +61,6 @@
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               ensureIdentifier(=, expression)
                                 listener: handleIdentifier(x, expression)
                               listener: handleNoTypeArguments(;)
@@ -70,7 +69,7 @@
                               listener: handleSend(x, x)
                   ensureSemicolon(x)
                   listener: handlePatternVariableDeclarationStatement(var, =, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/object_otherIdentifier_hide.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/object_otherIdentifier_hide.dart.intertwined.expect
index 1866b88..5d51387 100644
--- a/pkg/front_end/parser_testcases/patterns/object_otherIdentifier_hide.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/object_otherIdentifier_hide.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
@@ -61,7 +61,6 @@
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               ensureIdentifier(=, expression)
                                 listener: handleIdentifier(x, expression)
                               listener: handleNoTypeArguments(;)
@@ -70,7 +69,7 @@
                               listener: handleSend(x, x)
                   ensureSemicolon(x)
                   listener: handlePatternVariableDeclarationStatement(var, =, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/object_otherIdentifier_of.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/object_otherIdentifier_of.dart.intertwined.expect
index 90cd80e..9ff2179 100644
--- a/pkg/front_end/parser_testcases/patterns/object_otherIdentifier_of.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/object_otherIdentifier_of.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
@@ -61,7 +61,6 @@
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               ensureIdentifier(=, expression)
                                 listener: handleIdentifier(x, expression)
                               listener: handleNoTypeArguments(;)
@@ -70,7 +69,7 @@
                               listener: handleSend(x, x)
                   ensureSemicolon(x)
                   listener: handlePatternVariableDeclarationStatement(var, =, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/object_otherIdentifier_on.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/object_otherIdentifier_on.dart.intertwined.expect
index 8f491a2..2ddad84 100644
--- a/pkg/front_end/parser_testcases/patterns/object_otherIdentifier_on.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/object_otherIdentifier_on.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
@@ -61,7 +61,6 @@
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               ensureIdentifier(=, expression)
                                 listener: handleIdentifier(x, expression)
                               listener: handleNoTypeArguments(;)
@@ -70,7 +69,7 @@
                               listener: handleSend(x, x)
                   ensureSemicolon(x)
                   listener: handlePatternVariableDeclarationStatement(var, =, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/object_otherIdentifier_show.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/object_otherIdentifier_show.dart.intertwined.expect
index 364ad22..4d74699 100644
--- a/pkg/front_end/parser_testcases/patterns/object_otherIdentifier_show.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/object_otherIdentifier_show.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
@@ -61,7 +61,6 @@
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               ensureIdentifier(=, expression)
                                 listener: handleIdentifier(x, expression)
                               listener: handleNoTypeArguments(;)
@@ -70,7 +69,7 @@
                               listener: handleSend(x, x)
                   ensureSemicolon(x)
                   listener: handlePatternVariableDeclarationStatement(var, =, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/object_otherIdentifier_sync.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/object_otherIdentifier_sync.dart.intertwined.expect
index 9560316..5308367 100644
--- a/pkg/front_end/parser_testcases/patterns/object_otherIdentifier_sync.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/object_otherIdentifier_sync.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
@@ -61,7 +61,6 @@
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               ensureIdentifier(=, expression)
                                 listener: handleIdentifier(x, expression)
                               listener: handleNoTypeArguments(;)
@@ -70,7 +69,7 @@
                               listener: handleSend(x, x)
                   ensureSemicolon(x)
                   listener: handlePatternVariableDeclarationStatement(var, =, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/object_otherIdentifier_yield.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/object_otherIdentifier_yield.dart.intertwined.expect
index d69b776..94c2caf 100644
--- a/pkg/front_end/parser_testcases/patterns/object_otherIdentifier_yield.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/object_otherIdentifier_yield.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
@@ -61,7 +61,6 @@
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               ensureIdentifier(=, expression)
                                 listener: handleIdentifier(x, expression)
                               listener: handleNoTypeArguments(;)
@@ -70,7 +69,7 @@
                               listener: handleSend(x, x)
                   ensureSemicolon(x)
                   listener: handlePatternVariableDeclarationStatement(var, =, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/object_prefixedNamedUnderscore_withoutTypeArgs_insideDeclaration.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/object_prefixedNamedUnderscore_withoutTypeArgs_insideDeclaration.dart.intertwined.expect
index 62f11fc..c0e1627e 100644
--- a/pkg/front_end/parser_testcases/patterns/object_prefixedNamedUnderscore_withoutTypeArgs_insideDeclaration.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/object_prefixedNamedUnderscore_withoutTypeArgs_insideDeclaration.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
@@ -61,7 +61,6 @@
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               ensureIdentifier(=, expression)
                                 listener: handleIdentifier(x, expression)
                               listener: handleNoTypeArguments(;)
@@ -70,7 +69,7 @@
                               listener: handleSend(x, x)
                   ensureSemicolon(x)
                   listener: handlePatternVariableDeclarationStatement(var, =, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/object_prefixed_withTypeArgs_insideAssignment.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/object_prefixed_withTypeArgs_insideAssignment.dart.intertwined.expect
index d996c1c..40dfd8f 100644
--- a/pkg/front_end/parser_testcases/patterns/object_prefixed_withTypeArgs_insideAssignment.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/object_prefixed_withTypeArgs_insideAssignment.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, async)
+          notEofOrType(CLOSE_CURLY_BRACKET, async)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -68,7 +68,6 @@
                               parsePrimary(=, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                   parseSend(=, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(=)
                                     ensureIdentifier(=, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(;)
@@ -78,7 +77,7 @@
                         listener: handlePatternAssignment(=)
                     ensureSemicolon(x)
                     listener: handleExpressionStatement(async, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/object_prefixed_withTypeArgs_insideDeclaration.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/object_prefixed_withTypeArgs_insideDeclaration.dart.intertwined.expect
index 5adec6c..daba7e8 100644
--- a/pkg/front_end/parser_testcases/patterns/object_prefixed_withTypeArgs_insideDeclaration.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/object_prefixed_withTypeArgs_insideDeclaration.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
@@ -65,7 +65,6 @@
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               ensureIdentifier(=, expression)
                                 listener: handleIdentifier(x, expression)
                               listener: handleNoTypeArguments(;)
@@ -74,7 +73,7 @@
                               listener: handleSend(x, x)
                   ensureSemicolon(x)
                   listener: handlePatternVariableDeclarationStatement(var, =, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/object_recovery_bogusTokensAfterPatternField.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/object_recovery_bogusTokensAfterPatternField.dart.intertwined.expect
index f31dce5..9660a0f 100644
--- a/pkg/front_end/parser_testcases/patterns/object_recovery_bogusTokensAfterPatternField.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/object_recovery_bogusTokensAfterPatternField.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -102,10 +101,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/object_recovery_missingClosingParen.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/object_recovery_missingClosingParen.dart.intertwined.expect
index 503e3ce..eab8499 100644
--- a/pkg/front_end/parser_testcases/patterns/object_recovery_missingClosingParen.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/object_recovery_missingClosingParen.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -101,10 +100,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/object_recovery_missingComma.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/object_recovery_missingComma.dart.intertwined.expect
index 978f57d..afd675e 100644
--- a/pkg/front_end/parser_testcases/patterns/object_recovery_missingComma.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/object_recovery_missingComma.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -114,10 +113,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/object_unprefixedNamedUnderscore_withTypeArgs_insideDeclaration.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/object_unprefixedNamedUnderscore_withTypeArgs_insideDeclaration.dart.intertwined.expect
index 3a43da5..1e43a84 100644
--- a/pkg/front_end/parser_testcases/patterns/object_unprefixedNamedUnderscore_withTypeArgs_insideDeclaration.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/object_unprefixedNamedUnderscore_withTypeArgs_insideDeclaration.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
@@ -65,7 +65,6 @@
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               ensureIdentifier(=, expression)
                                 listener: handleIdentifier(x, expression)
                               listener: handleNoTypeArguments(;)
@@ -74,7 +73,7 @@
                               listener: handleSend(x, x)
                   ensureSemicolon(x)
                   listener: handlePatternVariableDeclarationStatement(var, =, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/object_unprefixedNamedUnderscore_withoutTypeArgs_insideDeclaration.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/object_unprefixedNamedUnderscore_withoutTypeArgs_insideDeclaration.dart.intertwined.expect
index 9fb071f..faa0dbb 100644
--- a/pkg/front_end/parser_testcases/patterns/object_unprefixedNamedUnderscore_withoutTypeArgs_insideDeclaration.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/object_unprefixedNamedUnderscore_withoutTypeArgs_insideDeclaration.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
@@ -61,7 +61,6 @@
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               ensureIdentifier(=, expression)
                                 listener: handleIdentifier(x, expression)
                               listener: handleNoTypeArguments(;)
@@ -70,7 +69,7 @@
                               listener: handleSend(x, x)
                   ensureSemicolon(x)
                   listener: handlePatternVariableDeclarationStatement(var, =, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/object_unprefixed_withTypeArgs_insideDeclaration.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/object_unprefixed_withTypeArgs_insideDeclaration.dart.intertwined.expect
index debc9d03..07b61a6 100644
--- a/pkg/front_end/parser_testcases/patterns/object_unprefixed_withTypeArgs_insideDeclaration.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/object_unprefixed_withTypeArgs_insideDeclaration.dart.intertwined.expect
@@ -33,7 +33,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(>, DeclarationKind.Class, C)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -70,7 +70,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
@@ -100,7 +100,6 @@
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               ensureIdentifier(=, expression)
                                 listener: handleIdentifier(x, expression)
                               listener: handleNoTypeArguments(;)
@@ -109,7 +108,7 @@
                               listener: handleSend(x, x)
                   ensureSemicolon(x)
                   listener: handlePatternVariableDeclarationStatement(var, =, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/parenthesized_insideAssignment.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/parenthesized_insideAssignment.dart.intertwined.expect
index 92940ed..4cff793 100644
--- a/pkg/front_end/parser_testcases/patterns/parenthesized_insideAssignment.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/parenthesized_insideAssignment.dart.intertwined.expect
@@ -36,7 +36,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -69,7 +69,6 @@
                               parsePrimary(=, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                   parseSend(=, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(=)
                                     ensureIdentifier(=, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(;)
@@ -79,7 +78,7 @@
                         listener: handlePatternAssignment(=)
                     ensureSemicolon(x)
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(f, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/parenthesized_insideCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/parenthesized_insideCase.dart.intertwined.expect
index 570b62c..c73bc91 100644
--- a/pkg/front_end/parser_testcases/patterns/parenthesized_insideCase.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/parenthesized_insideCase.dart.intertwined.expect
@@ -36,7 +36,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -52,7 +52,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -64,7 +63,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -99,10 +98,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(f, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/parenthesized_insideDeclaration.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/parenthesized_insideDeclaration.dart.intertwined.expect
index 0e2a7a3..6c49d90 100644
--- a/pkg/front_end/parser_testcases/patterns/parenthesized_insideDeclaration.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/parenthesized_insideDeclaration.dart.intertwined.expect
@@ -36,7 +36,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
@@ -67,7 +67,6 @@
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               ensureIdentifier(=, expression)
                                 listener: handleIdentifier(x, expression)
                               listener: handleNoTypeArguments(;)
@@ -76,7 +75,7 @@
                               listener: handleSend(x, x)
                   ensureSemicolon(x)
                   listener: handlePatternVariableDeclarationStatement(var, =, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(f, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/parenthesized_pattern_inside_cast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/parenthesized_pattern_inside_cast.dart.intertwined.expect
index db5f01e..c0c5c8d 100644
--- a/pkg/front_end/parser_testcases/patterns/parenthesized_pattern_inside_cast.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/parenthesized_pattern_inside_cast.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -108,10 +107,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/parenthesized_pattern_inside_null_assert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/parenthesized_pattern_inside_null_assert.dart.intertwined.expect
index ce32de7..347b8bb 100644
--- a/pkg/front_end/parser_testcases/patterns/parenthesized_pattern_inside_null_assert.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/parenthesized_pattern_inside_null_assert.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -102,10 +101,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/parenthesized_pattern_inside_null_check.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/parenthesized_pattern_inside_null_check.dart.intertwined.expect
index ed4a782..6dbeebd 100644
--- a/pkg/front_end/parser_testcases/patterns/parenthesized_pattern_inside_null_check.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/parenthesized_pattern_inside_null_check.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -102,10 +101,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_disallowsConst.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_disallowsConst.dart.intertwined.expect
index a2fd53b..a1fd2c9 100644
--- a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_disallowsConst.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_disallowsConst.dart.intertwined.expect
@@ -36,7 +36,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, const)
+          notEofOrType(CLOSE_CURLY_BRACKET, const)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrConstDeclaration({)
@@ -60,7 +60,6 @@
                                     parsePrimary((, expression, ConstantPatternContext.none)
                                       parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                         parseSend((, expression, ConstantPatternContext.none)
-                                          isNextIdentifier(()
                                           ensureIdentifier((, expression)
                                             listener: handleIdentifier(_, expression)
                                           listener: handleNoTypeArguments())
@@ -77,7 +76,6 @@
                           parsePrimary(=, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                               parseSend(=, expression, ConstantPatternContext.none)
-                                isNextIdentifier(=)
                                 ensureIdentifier(=, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(;)
@@ -87,7 +85,7 @@
                       listener: handleAssignmentExpression(=, x)
                   ensureSemicolon(x)
                   listener: handleExpressionStatement(const, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(f, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_disallowsLate.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_disallowsLate.dart.intertwined.expect
index 4950816..d99fa2b 100644
--- a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_disallowsLate.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_disallowsLate.dart.intertwined.expect
@@ -36,7 +36,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, late)
+          notEofOrType(CLOSE_CURLY_BRACKET, late)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -70,7 +70,6 @@
                           parsePrimary(=, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                               parseSend(=, expression, ConstantPatternContext.none)
-                                isNextIdentifier(=)
                                 ensureIdentifier(=, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(;)
@@ -79,7 +78,7 @@
                                 listener: handleSend(x, x)
                     ensureSemicolon(x)
                     listener: handlePatternVariableDeclarationStatement(var, =, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(f, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_final_extractor.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_final_extractor.dart.intertwined.expect
index 722a121..a55839c 100644
--- a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_final_extractor.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_final_extractor.dart.intertwined.expect
@@ -36,7 +36,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, final)
+          notEofOrType(CLOSE_CURLY_BRACKET, final)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(final, {, null, final, null, null)
@@ -72,7 +72,6 @@
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               ensureIdentifier(=, expression)
                                 listener: handleIdentifier(x, expression)
                               listener: handleNoTypeArguments(;)
@@ -81,7 +80,7 @@
                               listener: handleSend(x, x)
                   ensureSemicolon(x)
                   listener: handlePatternVariableDeclarationStatement(final, =, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(f, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_var_extractor.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_var_extractor.dart.intertwined.expect
index 8480dc7..7d5b517 100644
--- a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_var_extractor.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_var_extractor.dart.intertwined.expect
@@ -36,7 +36,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
@@ -72,7 +72,6 @@
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               ensureIdentifier(=, expression)
                                 listener: handleIdentifier(x, expression)
                               listener: handleNoTypeArguments(;)
@@ -81,7 +80,7 @@
                               listener: handleSend(x, x)
                   ensureSemicolon(x)
                   listener: handlePatternVariableDeclarationStatement(var, =, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(f, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_var_list.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_var_list.dart.intertwined.expect
index 3549d1f..279eeff 100644
--- a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_var_list.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_var_list.dart.intertwined.expect
@@ -36,7 +36,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
@@ -67,7 +67,6 @@
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               ensureIdentifier(=, expression)
                                 listener: handleIdentifier(x, expression)
                               listener: handleNoTypeArguments(;)
@@ -76,7 +75,7 @@
                               listener: handleSend(x, x)
                   ensureSemicolon(x)
                   listener: handlePatternVariableDeclarationStatement(var, =, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(f, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_var_map.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_var_map.dart.intertwined.expect
index 3740399..0aaec62 100644
--- a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_var_map.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_var_map.dart.intertwined.expect
@@ -36,7 +36,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
@@ -78,7 +78,6 @@
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               ensureIdentifier(=, expression)
                                 listener: handleIdentifier(x, expression)
                               listener: handleNoTypeArguments(;)
@@ -87,7 +86,7 @@
                               listener: handleSend(x, x)
                   ensureSemicolon(x)
                   listener: handlePatternVariableDeclarationStatement(var, =, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(f, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_var_parenthesized.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_var_parenthesized.dart.intertwined.expect
index 0e2a7a3..6c49d90 100644
--- a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_var_parenthesized.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_var_parenthesized.dart.intertwined.expect
@@ -36,7 +36,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
@@ -67,7 +67,6 @@
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               ensureIdentifier(=, expression)
                                 listener: handleIdentifier(x, expression)
                               listener: handleNoTypeArguments(;)
@@ -76,7 +75,7 @@
                               listener: handleSend(x, x)
                   ensureSemicolon(x)
                   listener: handlePatternVariableDeclarationStatement(var, =, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(f, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_var_record.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_var_record.dart.intertwined.expect
index f27e6b5..8293aac8 100644
--- a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_var_record.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_var_record.dart.intertwined.expect
@@ -36,7 +36,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
@@ -68,7 +68,6 @@
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               ensureIdentifier(=, expression)
                                 listener: handleIdentifier(x, expression)
                               listener: handleNoTypeArguments(;)
@@ -77,7 +76,7 @@
                               listener: handleSend(x, x)
                   ensureSemicolon(x)
                   listener: handlePatternVariableDeclarationStatement(var, =, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(f, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_final_extractor.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_final_extractor.dart.intertwined.expect
index 1bcabc1..4cdd4d1 100644
--- a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_final_extractor.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_final_extractor.dart.intertwined.expect
@@ -36,7 +36,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, @)
+          notEofOrType(CLOSE_CURLY_BRACKET, @)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -83,7 +83,6 @@
                           parsePrimary(=, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                               parseSend(=, expression, ConstantPatternContext.none)
-                                isNextIdentifier(=)
                                 ensureIdentifier(=, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(;)
@@ -92,7 +91,7 @@
                                 listener: handleSend(x, x)
                     ensureSemicolon(x)
                     listener: handlePatternVariableDeclarationStatement(final, =, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(f, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_final_list.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_final_list.dart.intertwined.expect
index 6ee4450..b2661fd 100644
--- a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_final_list.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_final_list.dart.intertwined.expect
@@ -36,7 +36,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, @)
+          notEofOrType(CLOSE_CURLY_BRACKET, @)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -78,7 +78,6 @@
                           parsePrimary(=, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                               parseSend(=, expression, ConstantPatternContext.none)
-                                isNextIdentifier(=)
                                 ensureIdentifier(=, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(;)
@@ -87,7 +86,7 @@
                                 listener: handleSend(x, x)
                     ensureSemicolon(x)
                     listener: handlePatternVariableDeclarationStatement(final, =, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(f, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_final_map.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_final_map.dart.intertwined.expect
index 830d058..2ea7602 100644
--- a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_final_map.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_final_map.dart.intertwined.expect
@@ -36,7 +36,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, @)
+          notEofOrType(CLOSE_CURLY_BRACKET, @)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -89,7 +89,6 @@
                           parsePrimary(=, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                               parseSend(=, expression, ConstantPatternContext.none)
-                                isNextIdentifier(=)
                                 ensureIdentifier(=, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(;)
@@ -98,7 +97,7 @@
                                 listener: handleSend(x, x)
                     ensureSemicolon(x)
                     listener: handlePatternVariableDeclarationStatement(final, =, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(f, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_final_parenthesized.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_final_parenthesized.dart.intertwined.expect
index e01d55f..9ddad76 100644
--- a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_final_parenthesized.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_final_parenthesized.dart.intertwined.expect
@@ -36,7 +36,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, @)
+          notEofOrType(CLOSE_CURLY_BRACKET, @)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -78,7 +78,6 @@
                           parsePrimary(=, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                               parseSend(=, expression, ConstantPatternContext.none)
-                                isNextIdentifier(=)
                                 ensureIdentifier(=, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(;)
@@ -87,7 +86,7 @@
                                 listener: handleSend(x, x)
                     ensureSemicolon(x)
                     listener: handlePatternVariableDeclarationStatement(final, =, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(f, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_final_record.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_final_record.dart.intertwined.expect
index 2da6386..b9cb567 100644
--- a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_final_record.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_final_record.dart.intertwined.expect
@@ -36,7 +36,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, @)
+          notEofOrType(CLOSE_CURLY_BRACKET, @)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -79,7 +79,6 @@
                           parsePrimary(=, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                               parseSend(=, expression, ConstantPatternContext.none)
-                                isNextIdentifier(=)
                                 ensureIdentifier(=, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(;)
@@ -88,7 +87,7 @@
                                 listener: handleSend(x, x)
                     ensureSemicolon(x)
                     listener: handlePatternVariableDeclarationStatement(final, =, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(f, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_var_extractor.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_var_extractor.dart.intertwined.expect
index 3fb7620..bfbeed8 100644
--- a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_var_extractor.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_var_extractor.dart.intertwined.expect
@@ -36,7 +36,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, @)
+          notEofOrType(CLOSE_CURLY_BRACKET, @)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -83,7 +83,6 @@
                           parsePrimary(=, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                               parseSend(=, expression, ConstantPatternContext.none)
-                                isNextIdentifier(=)
                                 ensureIdentifier(=, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(;)
@@ -92,7 +91,7 @@
                                 listener: handleSend(x, x)
                     ensureSemicolon(x)
                     listener: handlePatternVariableDeclarationStatement(var, =, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(f, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_var_list.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_var_list.dart.intertwined.expect
index 34c6eee..19b66f2 100644
--- a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_var_list.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_var_list.dart.intertwined.expect
@@ -36,7 +36,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, @)
+          notEofOrType(CLOSE_CURLY_BRACKET, @)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -78,7 +78,6 @@
                           parsePrimary(=, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                               parseSend(=, expression, ConstantPatternContext.none)
-                                isNextIdentifier(=)
                                 ensureIdentifier(=, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(;)
@@ -87,7 +86,7 @@
                                 listener: handleSend(x, x)
                     ensureSemicolon(x)
                     listener: handlePatternVariableDeclarationStatement(var, =, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(f, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_var_map.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_var_map.dart.intertwined.expect
index 0201fb0..06347a2 100644
--- a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_var_map.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_var_map.dart.intertwined.expect
@@ -36,7 +36,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, @)
+          notEofOrType(CLOSE_CURLY_BRACKET, @)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -89,7 +89,6 @@
                           parsePrimary(=, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                               parseSend(=, expression, ConstantPatternContext.none)
-                                isNextIdentifier(=)
                                 ensureIdentifier(=, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(;)
@@ -98,7 +97,7 @@
                                 listener: handleSend(x, x)
                     ensureSemicolon(x)
                     listener: handlePatternVariableDeclarationStatement(var, =, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(f, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_var_parenthesized.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_var_parenthesized.dart.intertwined.expect
index 4ec203f..18d9f86 100644
--- a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_var_parenthesized.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_var_parenthesized.dart.intertwined.expect
@@ -36,7 +36,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, @)
+          notEofOrType(CLOSE_CURLY_BRACKET, @)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -78,7 +78,6 @@
                           parsePrimary(=, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                               parseSend(=, expression, ConstantPatternContext.none)
-                                isNextIdentifier(=)
                                 ensureIdentifier(=, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(;)
@@ -87,7 +86,7 @@
                                 listener: handleSend(x, x)
                     ensureSemicolon(x)
                     listener: handlePatternVariableDeclarationStatement(var, =, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(f, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_var_record.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_var_record.dart.intertwined.expect
index b86fc1a..3a89417 100644
--- a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_var_record.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_var_record.dart.intertwined.expect
@@ -36,7 +36,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, @)
+          notEofOrType(CLOSE_CURLY_BRACKET, @)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -79,7 +79,6 @@
                           parsePrimary(=, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                               parseSend(=, expression, ConstantPatternContext.none)
-                                isNextIdentifier(=)
                                 ensureIdentifier(=, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(;)
@@ -88,7 +87,7 @@
                                 listener: handleSend(x, x)
                     ensureSemicolon(x)
                     listener: handlePatternVariableDeclarationStatement(var, =, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(f, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/patternVariableDeclaration_inClass.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/patternVariableDeclaration_inClass.dart.intertwined.expect
index 5280a6d..e1a8f9c 100644
--- a/pkg/front_end/parser_testcases/patterns/patternVariableDeclaration_inClass.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/patternVariableDeclaration_inClass.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(C, DeclarationKind.Class, C)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, var)
+            notEofOrType(CLOSE_CURLY_BRACKET, var)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, C)
               parseMetadataStar({)
                 listener: beginMetadataStar(var)
@@ -73,7 +73,7 @@
                   listener: endFieldInitializer(=, ))
                 listener: endClassFields(null, null, null, null, null, null, var, 1, var, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/pattern_inForIn_element.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/pattern_inForIn_element.dart.intertwined.expect
index acc4f0d..98c6bd4 100644
--- a/pkg/front_end/parser_testcases/patterns/pattern_inForIn_element.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/pattern_inForIn_element.dart.intertwined.expect
@@ -84,7 +84,6 @@
                               parsePrimary(in, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(in, expression, ConstantPatternContext.none)
                                   parseSend(in, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(in)
                                     ensureIdentifier(in, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments())
diff --git a/pkg/front_end/parser_testcases/patterns/pattern_inForIn_element_withMetadata.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/pattern_inForIn_element_withMetadata.dart.intertwined.expect
index 985750b..d5d64e0 100644
--- a/pkg/front_end/parser_testcases/patterns/pattern_inForIn_element_withMetadata.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/pattern_inForIn_element_withMetadata.dart.intertwined.expect
@@ -94,7 +94,6 @@
                               parsePrimary(in, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(in, expression, ConstantPatternContext.none)
                                   parseSend(in, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(in)
                                     ensureIdentifier(in, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments())
diff --git a/pkg/front_end/parser_testcases/patterns/pattern_inForIn_statement.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/pattern_inForIn_statement.dart.intertwined.expect
index 2a1ed17..62a5107 100644
--- a/pkg/front_end/parser_testcases/patterns/pattern_inForIn_statement.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/pattern_inForIn_statement.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, for)
+          notEofOrType(CLOSE_CURLY_BRACKET, for)
           parseStatement({)
             parseStatementX({)
               parseForStatement({, null)
@@ -81,7 +81,6 @@
                           parsePrimary(in, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(in, expression, ConstantPatternContext.none)
                               parseSend(in, expression, ConstantPatternContext.none)
-                                isNextIdentifier(in)
                                 ensureIdentifier(in, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -97,11 +96,11 @@
                       parseBlock(), BlockKind(statement))
                         ensureBlock(), BlockKind(statement))
                         listener: beginBlock({, BlockKind(statement))
-                        notEofOrValue(}, })
+                        notEofOrType(CLOSE_CURLY_BRACKET, })
                         listener: endBlock(0, {, }, BlockKind(statement))
                   listener: endForInBody(})
                   listener: endForIn(})
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/pattern_inForIn_statement_withMetadata.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/pattern_inForIn_statement_withMetadata.dart.intertwined.expect
index 9b79fae..31b2cfa 100644
--- a/pkg/front_end/parser_testcases/patterns/pattern_inForIn_statement_withMetadata.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/pattern_inForIn_statement_withMetadata.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, for)
+          notEofOrType(CLOSE_CURLY_BRACKET, for)
           parseStatement({)
             parseStatementX({)
               parseForStatement({, null)
@@ -91,7 +91,6 @@
                           parsePrimary(in, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral(in, expression, ConstantPatternContext.none)
                               parseSend(in, expression, ConstantPatternContext.none)
-                                isNextIdentifier(in)
                                 ensureIdentifier(in, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -107,11 +106,11 @@
                       parseBlock(), BlockKind(statement))
                         ensureBlock(), BlockKind(statement))
                         listener: beginBlock({, BlockKind(statement))
-                        notEofOrValue(}, })
+                        notEofOrType(CLOSE_CURLY_BRACKET, })
                         listener: endBlock(0, {, }, BlockKind(statement))
                   listener: endForInBody(})
                   listener: endForIn(})
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/pattern_inForInitializer_element.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/pattern_inForInitializer_element.dart.intertwined.expect
index c770bfc..e0079f3 100644
--- a/pkg/front_end/parser_testcases/patterns/pattern_inForInitializer_element.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/pattern_inForInitializer_element.dart.intertwined.expect
@@ -82,7 +82,6 @@
                             parsePrimary(=, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                 parseSend(=, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(=)
                                   ensureIdentifier(=, expression)
                                     listener: handleIdentifier(x, expression)
                                   listener: handleNoTypeArguments(;)
diff --git a/pkg/front_end/parser_testcases/patterns/pattern_inForInitializer_statement.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/pattern_inForInitializer_statement.dart.intertwined.expect
index ac22f57..045fc9f 100644
--- a/pkg/front_end/parser_testcases/patterns/pattern_inForInitializer_statement.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/pattern_inForInitializer_statement.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, for)
+          notEofOrType(CLOSE_CURLY_BRACKET, for)
           parseStatement({)
             parseStatementX({)
               parseForStatement({, null)
@@ -78,7 +78,6 @@
                       parsePrimary(=, expression, ConstantPatternContext.none)
                         parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                           parseSend(=, expression, ConstantPatternContext.none)
-                            isNextIdentifier(=)
                             ensureIdentifier(=, expression)
                               listener: handleIdentifier(x, expression)
                             listener: handleNoTypeArguments(;)
@@ -98,11 +97,11 @@
                       parseBlock(), BlockKind(statement))
                         ensureBlock(), BlockKind(statement))
                         listener: beginBlock({, BlockKind(statement))
-                        notEofOrValue(}, })
+                        notEofOrType(CLOSE_CURLY_BRACKET, })
                         listener: endBlock(0, {, }, BlockKind(statement))
                   listener: endForStatementBody(})
                   listener: endForStatement(})
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/prefixedIdentifier_when_not.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/prefixedIdentifier_when_not.dart.intertwined.expect
index 667d46e..039dd82 100644
--- a/pkg/front_end/parser_testcases/patterns/prefixedIdentifier_when_not.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/prefixedIdentifier_when_not.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -75,7 +74,6 @@
                           parsePrimary(case, expression, ConstantPatternContext.implicit)
                             parseSendOrFunctionLiteral(case, expression, ConstantPatternContext.implicit)
                               parseSend(case, expression, ConstantPatternContext.implicit)
-                                isNextIdentifier(case)
                                 ensureIdentifier(case, expression)
                                   listener: handleIdentifier(Enum, expression)
                                 listener: handleNoTypeArguments(.)
@@ -85,7 +83,6 @@
                         parsePrimary(., expressionContinuation, ConstantPatternContext.implicit)
                           parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.implicit)
                             parseSend(., expressionContinuation, ConstantPatternContext.implicit)
-                              isNextIdentifier(.)
                               ensureIdentifier(., expressionContinuation)
                                 listener: handleIdentifier(value, expressionContinuation)
                               listener: handleNoTypeArguments(when)
@@ -106,7 +103,6 @@
                             parsePrimary(!, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(!, expression, ConstantPatternContext.none)
                                 parseSend(!, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(!)
                                   ensureIdentifier(!, expression)
                                     listener: handleIdentifier(flag, expression)
                                   listener: handleNoTypeArguments(:)
@@ -121,10 +117,10 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/prefixed_extractor_pattern_with_type_args.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/prefixed_extractor_pattern_with_type_args.dart.intertwined.expect
index ef13f78..bfdb6d3 100644
--- a/pkg/front_end/parser_testcases/patterns/prefixed_extractor_pattern_with_type_args.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/prefixed_extractor_pattern_with_type_args.dart.intertwined.expect
@@ -63,7 +63,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -79,7 +79,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -91,7 +90,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -120,10 +119,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/prefixed_extractor_pattern_with_type_args_inside_cast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/prefixed_extractor_pattern_with_type_args_inside_cast.dart.intertwined.expect
index 5839760..de862eb 100644
--- a/pkg/front_end/parser_testcases/patterns/prefixed_extractor_pattern_with_type_args_inside_cast.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/prefixed_extractor_pattern_with_type_args_inside_cast.dart.intertwined.expect
@@ -63,7 +63,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -79,7 +79,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -91,7 +90,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -127,10 +126,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/prefixed_extractor_pattern_with_type_args_inside_null_assert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/prefixed_extractor_pattern_with_type_args_inside_null_assert.dart.intertwined.expect
index 0f452fb..7d090c8e 100644
--- a/pkg/front_end/parser_testcases/patterns/prefixed_extractor_pattern_with_type_args_inside_null_assert.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/prefixed_extractor_pattern_with_type_args_inside_null_assert.dart.intertwined.expect
@@ -63,7 +63,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -79,7 +79,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -91,7 +90,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -121,10 +120,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/prefixed_extractor_pattern_with_type_args_inside_null_check.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/prefixed_extractor_pattern_with_type_args_inside_null_check.dart.intertwined.expect
index 52a450c..1b6d7e8 100644
--- a/pkg/front_end/parser_testcases/patterns/prefixed_extractor_pattern_with_type_args_inside_null_check.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/prefixed_extractor_pattern_with_type_args_inside_null_check.dart.intertwined.expect
@@ -63,7 +63,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -79,7 +79,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -91,7 +90,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -121,10 +120,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/recordPattern_nonNullable_beforeAs.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/recordPattern_nonNullable_beforeAs.dart.intertwined.expect
index c4061cb..64b4253 100644
--- a/pkg/front_end/parser_testcases/patterns/recordPattern_nonNullable_beforeAs.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/recordPattern_nonNullable_beforeAs.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -105,10 +104,10 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/recordPattern_nonNullable_beforeWhen.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/recordPattern_nonNullable_beforeWhen.dart.intertwined.expect
index e944184..3140070 100644
--- a/pkg/front_end/parser_testcases/patterns/recordPattern_nonNullable_beforeWhen.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/recordPattern_nonNullable_beforeWhen.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -97,10 +96,10 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/recordPattern_nullable_beforeAs.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/recordPattern_nullable_beforeAs.dart.intertwined.expect
index b58ca0c..e37f8cf 100644
--- a/pkg/front_end/parser_testcases/patterns/recordPattern_nullable_beforeAs.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/recordPattern_nullable_beforeAs.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -108,10 +107,10 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/recordPattern_nullable_beforeWhen.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/recordPattern_nullable_beforeWhen.dart.intertwined.expect
index 75fc3e3..1da1caf 100644
--- a/pkg/front_end/parser_testcases/patterns/recordPattern_nullable_beforeWhen.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/recordPattern_nullable_beforeWhen.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -98,10 +97,10 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nonNullable_beforeAnd.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nonNullable_beforeAnd.dart.intertwined.expect
index a3c1c89..633b1ec 100644
--- a/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nonNullable_beforeAnd.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nonNullable_beforeAnd.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -101,10 +100,10 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nonNullable_beforeAs.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nonNullable_beforeAs.dart.intertwined.expect
index 028df9f..7144fa8 100644
--- a/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nonNullable_beforeAs.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nonNullable_beforeAs.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -109,10 +108,10 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nonNullable_beforeColon.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nonNullable_beforeColon.dart.intertwined.expect
index 40ccab4..74f9fa2 100644
--- a/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nonNullable_beforeColon.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nonNullable_beforeColon.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -92,10 +91,10 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nonNullable_beforeComma.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nonNullable_beforeComma.dart.intertwined.expect
index e4c5740..b587bfe 100644
--- a/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nonNullable_beforeComma.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nonNullable_beforeComma.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -106,10 +105,10 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nonNullable_beforeExclamation.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nonNullable_beforeExclamation.dart.intertwined.expect
index fe66120..7d6866a 100644
--- a/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nonNullable_beforeExclamation.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nonNullable_beforeExclamation.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -93,10 +92,10 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nonNullable_beforeOr.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nonNullable_beforeOr.dart.intertwined.expect
index 7f225b9..4fa8380 100644
--- a/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nonNullable_beforeOr.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nonNullable_beforeOr.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -101,10 +100,10 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nonNullable_beforeQuestion.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nonNullable_beforeQuestion.dart.intertwined.expect
index dd35893..f909c35 100644
--- a/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nonNullable_beforeQuestion.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nonNullable_beforeQuestion.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -93,10 +92,10 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nonNullable_beforeRightArrow.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nonNullable_beforeRightArrow.dart.intertwined.expect
index cdddf44..eda4aa8 100644
--- a/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nonNullable_beforeRightArrow.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nonNullable_beforeRightArrow.dart.intertwined.expect
@@ -55,7 +55,6 @@
                                 parsePrimary((, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                     parseSend((, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(()
                                       ensureIdentifier((, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments())
diff --git a/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nonNullable_beforeRightBrace.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nonNullable_beforeRightBrace.dart.intertwined.expect
index 613a02d..e5510d7 100644
--- a/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nonNullable_beforeRightBrace.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nonNullable_beforeRightBrace.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -108,10 +107,10 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nonNullable_beforeRightBracket.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nonNullable_beforeRightBracket.dart.intertwined.expect
index 132de01..1b0782a 100644
--- a/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nonNullable_beforeRightBracket.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nonNullable_beforeRightBracket.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -99,10 +98,10 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nonNullable_beforeRightParen.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nonNullable_beforeRightParen.dart.intertwined.expect
index cf5c51e..c06c3e2 100644
--- a/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nonNullable_beforeRightParen.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nonNullable_beforeRightParen.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -99,10 +98,10 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nonNullable_beforeWhen.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nonNullable_beforeWhen.dart.intertwined.expect
index 024300a7..d9831d2 100644
--- a/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nonNullable_beforeWhen.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nonNullable_beforeWhen.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -101,10 +100,10 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nullable_beforeAnd.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nullable_beforeAnd.dart.intertwined.expect
index a7025cc..9f319ac 100644
--- a/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nullable_beforeAnd.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nullable_beforeAnd.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -101,10 +100,10 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nullable_beforeAs.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nullable_beforeAs.dart.intertwined.expect
index 018a446..1e9a427 100644
--- a/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nullable_beforeAs.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nullable_beforeAs.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -109,10 +108,10 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nullable_beforeColon.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nullable_beforeColon.dart.intertwined.expect
index 940c224..d6750ed 100644
--- a/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nullable_beforeColon.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nullable_beforeColon.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -92,10 +91,10 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nullable_beforeComma.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nullable_beforeComma.dart.intertwined.expect
index 85646ac..1aa15e3 100644
--- a/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nullable_beforeComma.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nullable_beforeComma.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -106,10 +105,10 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nullable_beforeExclamation.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nullable_beforeExclamation.dart.intertwined.expect
index c152a67..d7fbc14 100644
--- a/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nullable_beforeExclamation.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nullable_beforeExclamation.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -93,10 +92,10 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nullable_beforeOr.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nullable_beforeOr.dart.intertwined.expect
index a20e45b..a91fcfe 100644
--- a/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nullable_beforeOr.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nullable_beforeOr.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -101,10 +100,10 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nullable_beforeQuestion.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nullable_beforeQuestion.dart.intertwined.expect
index 5d1b4a3..9398180 100644
--- a/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nullable_beforeQuestion.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nullable_beforeQuestion.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -93,10 +92,10 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nullable_beforeRightArrow.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nullable_beforeRightArrow.dart.intertwined.expect
index 20ca392..aa60109 100644
--- a/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nullable_beforeRightArrow.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nullable_beforeRightArrow.dart.intertwined.expect
@@ -55,7 +55,6 @@
                                 parsePrimary((, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                     parseSend((, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(()
                                       ensureIdentifier((, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments())
diff --git a/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nullable_beforeRightBrace.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nullable_beforeRightBrace.dart.intertwined.expect
index c681333..204088a 100644
--- a/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nullable_beforeRightBrace.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nullable_beforeRightBrace.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -108,10 +107,10 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nullable_beforeRightBracket.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nullable_beforeRightBracket.dart.intertwined.expect
index c81db26..250283f 100644
--- a/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nullable_beforeRightBracket.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nullable_beforeRightBracket.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -99,10 +98,10 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nullable_beforeRightParen.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nullable_beforeRightParen.dart.intertwined.expect
index 0a44b31..2803481 100644
--- a/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nullable_beforeRightParen.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nullable_beforeRightParen.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -99,10 +98,10 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nullable_beforeWhen.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nullable_beforeWhen.dart.intertwined.expect
index 0ab40b4..1ebcee5 100644
--- a/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nullable_beforeWhen.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/recordTypedVariablePattern_nullable_beforeWhen.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -101,10 +100,10 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nonNullable_beforeAnd.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nonNullable_beforeAnd.dart.intertwined.expect
index aaf09b8..b594d01 100644
--- a/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nonNullable_beforeAnd.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nonNullable_beforeAnd.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -101,10 +100,10 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nonNullable_beforeAs.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nonNullable_beforeAs.dart.intertwined.expect
index d01602c..8fd09fe 100644
--- a/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nonNullable_beforeAs.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nonNullable_beforeAs.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -109,10 +108,10 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nonNullable_beforeColon.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nonNullable_beforeColon.dart.intertwined.expect
index 363c21c..db82a8f 100644
--- a/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nonNullable_beforeColon.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nonNullable_beforeColon.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -92,10 +91,10 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nonNullable_beforeComma.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nonNullable_beforeComma.dart.intertwined.expect
index da768d8..a3daf58 100644
--- a/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nonNullable_beforeComma.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nonNullable_beforeComma.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -106,10 +105,10 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nonNullable_beforeExclamation.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nonNullable_beforeExclamation.dart.intertwined.expect
index b66e54c..d3cc466 100644
--- a/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nonNullable_beforeExclamation.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nonNullable_beforeExclamation.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -93,10 +92,10 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nonNullable_beforeOr.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nonNullable_beforeOr.dart.intertwined.expect
index 273c73fd..2480d08 100644
--- a/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nonNullable_beforeOr.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nonNullable_beforeOr.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -101,10 +100,10 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nonNullable_beforeQuestion.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nonNullable_beforeQuestion.dart.intertwined.expect
index dc6036e..cf4ef20 100644
--- a/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nonNullable_beforeQuestion.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nonNullable_beforeQuestion.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -93,10 +92,10 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nonNullable_beforeRightArrow.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nonNullable_beforeRightArrow.dart.intertwined.expect
index d568032..c778bd4 100644
--- a/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nonNullable_beforeRightArrow.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nonNullable_beforeRightArrow.dart.intertwined.expect
@@ -55,7 +55,6 @@
                                 parsePrimary((, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                     parseSend((, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(()
                                       ensureIdentifier((, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments())
diff --git a/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nonNullable_beforeRightBrace.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nonNullable_beforeRightBrace.dart.intertwined.expect
index f137825..7c3c6a0 100644
--- a/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nonNullable_beforeRightBrace.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nonNullable_beforeRightBrace.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -108,10 +107,10 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nonNullable_beforeRightBracket.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nonNullable_beforeRightBracket.dart.intertwined.expect
index d7fa2ab..02b7536 100644
--- a/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nonNullable_beforeRightBracket.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nonNullable_beforeRightBracket.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -99,10 +98,10 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nonNullable_beforeRightParen.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nonNullable_beforeRightParen.dart.intertwined.expect
index a86727f..16f380f 100644
--- a/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nonNullable_beforeRightParen.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nonNullable_beforeRightParen.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -99,10 +98,10 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nonNullable_beforeWhen.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nonNullable_beforeWhen.dart.intertwined.expect
index 482ebff..ad9b7f8 100644
--- a/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nonNullable_beforeWhen.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nonNullable_beforeWhen.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -101,10 +100,10 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nullable_beforeAnd.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nullable_beforeAnd.dart.intertwined.expect
index 8c291e2..284f34e 100644
--- a/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nullable_beforeAnd.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nullable_beforeAnd.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -101,10 +100,10 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nullable_beforeAs.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nullable_beforeAs.dart.intertwined.expect
index 863356d..c136130 100644
--- a/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nullable_beforeAs.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nullable_beforeAs.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -109,10 +108,10 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nullable_beforeColon.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nullable_beforeColon.dart.intertwined.expect
index 527f2fe..caf89aa 100644
--- a/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nullable_beforeColon.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nullable_beforeColon.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -92,10 +91,10 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nullable_beforeComma.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nullable_beforeComma.dart.intertwined.expect
index 56a252e..895b27f 100644
--- a/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nullable_beforeComma.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nullable_beforeComma.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -106,10 +105,10 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nullable_beforeExclamation.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nullable_beforeExclamation.dart.intertwined.expect
index 078e416..0fe677a 100644
--- a/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nullable_beforeExclamation.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nullable_beforeExclamation.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -93,10 +92,10 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nullable_beforeOr.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nullable_beforeOr.dart.intertwined.expect
index 57fa49f..d758f41 100644
--- a/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nullable_beforeOr.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nullable_beforeOr.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -101,10 +100,10 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nullable_beforeQuestion.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nullable_beforeQuestion.dart.intertwined.expect
index 6c2649d..bfe4982 100644
--- a/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nullable_beforeQuestion.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nullable_beforeQuestion.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -93,10 +92,10 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nullable_beforeRightArrow.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nullable_beforeRightArrow.dart.intertwined.expect
index f0c916d..effe80f 100644
--- a/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nullable_beforeRightArrow.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nullable_beforeRightArrow.dart.intertwined.expect
@@ -55,7 +55,6 @@
                                 parsePrimary((, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                     parseSend((, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(()
                                       ensureIdentifier((, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments())
diff --git a/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nullable_beforeRightBrace.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nullable_beforeRightBrace.dart.intertwined.expect
index 772aa48..6888613 100644
--- a/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nullable_beforeRightBrace.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nullable_beforeRightBrace.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -108,10 +107,10 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nullable_beforeRightBracket.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nullable_beforeRightBracket.dart.intertwined.expect
index 247c6e5..85eb0f3 100644
--- a/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nullable_beforeRightBracket.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nullable_beforeRightBracket.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -99,10 +98,10 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nullable_beforeRightParen.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nullable_beforeRightParen.dart.intertwined.expect
index 0e31d0e..07ff68d 100644
--- a/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nullable_beforeRightParen.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nullable_beforeRightParen.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -99,10 +98,10 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nullable_beforeWhen.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nullable_beforeWhen.dart.intertwined.expect
index 0c5a8c2..b6be8fa 100644
--- a/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nullable_beforeWhen.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/recordTypedWildcardPattern_nullable_beforeWhen.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -101,10 +100,10 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/record_insideAssignment_empty.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/record_insideAssignment_empty.dart.intertwined.expect
index 7e54987..546d08d 100644
--- a/pkg/front_end/parser_testcases/patterns/record_insideAssignment_empty.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/record_insideAssignment_empty.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -60,7 +60,6 @@
                               parsePrimary(=, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                   parseSend(=, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(=)
                                     ensureIdentifier(=, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(;)
@@ -70,7 +69,7 @@
                         listener: handlePatternAssignment(=)
                     ensureSemicolon(x)
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/record_insideAssignment_oneField.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/record_insideAssignment_oneField.dart.intertwined.expect
index 0fdb27c..58542f1 100644
--- a/pkg/front_end/parser_testcases/patterns/record_insideAssignment_oneField.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/record_insideAssignment_oneField.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -69,7 +69,6 @@
                               parsePrimary(=, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                   parseSend(=, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(=)
                                     ensureIdentifier(=, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(;)
@@ -79,7 +78,7 @@
                         listener: handlePatternAssignment(=)
                     ensureSemicolon(x)
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/record_insideAssignment_twoFields.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/record_insideAssignment_twoFields.dart.intertwined.expect
index 067ff2c..862b369 100644
--- a/pkg/front_end/parser_testcases/patterns/record_insideAssignment_twoFields.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/record_insideAssignment_twoFields.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -76,7 +76,6 @@
                               parsePrimary(=, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                   parseSend(=, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(=)
                                     ensureIdentifier(=, expression)
                                       listener: handleIdentifier(x, expression)
                                     listener: handleNoTypeArguments(;)
@@ -86,7 +85,7 @@
                         listener: handlePatternAssignment(=)
                     ensureSemicolon(x)
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/record_insideDeclaration_empty.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/record_insideDeclaration_empty.dart.intertwined.expect
index f303bc7..f1f3b0d 100644
--- a/pkg/front_end/parser_testcases/patterns/record_insideDeclaration_empty.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/record_insideDeclaration_empty.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
@@ -57,7 +57,6 @@
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               ensureIdentifier(=, expression)
                                 listener: handleIdentifier(x, expression)
                               listener: handleNoTypeArguments(;)
@@ -66,7 +65,7 @@
                               listener: handleSend(x, x)
                   ensureSemicolon(x)
                   listener: handlePatternVariableDeclarationStatement(var, =, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/record_insideDeclaration_oneField.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/record_insideDeclaration_oneField.dart.intertwined.expect
index aa3ccf3..fc584f7 100644
--- a/pkg/front_end/parser_testcases/patterns/record_insideDeclaration_oneField.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/record_insideDeclaration_oneField.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
@@ -67,7 +67,6 @@
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               ensureIdentifier(=, expression)
                                 listener: handleIdentifier(x, expression)
                               listener: handleNoTypeArguments(;)
@@ -76,7 +75,7 @@
                               listener: handleSend(x, x)
                   ensureSemicolon(x)
                   listener: handlePatternVariableDeclarationStatement(var, =, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/record_insideDeclaration_twoFields.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/record_insideDeclaration_twoFields.dart.intertwined.expect
index e2d878f..6e23a2d 100644
--- a/pkg/front_end/parser_testcases/patterns/record_insideDeclaration_twoFields.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/record_insideDeclaration_twoFields.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
@@ -75,7 +75,6 @@
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               ensureIdentifier(=, expression)
                                 listener: handleIdentifier(x, expression)
                               listener: handleNoTypeArguments(;)
@@ -84,7 +83,7 @@
                               listener: handleSend(x, x)
                   ensureSemicolon(x)
                   listener: handlePatternVariableDeclarationStatement(var, =, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/record_pattern_inside_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/record_pattern_inside_case.dart.intertwined.expect
index 778f07f..8eb4b29 100644
--- a/pkg/front_end/parser_testcases/patterns/record_pattern_inside_case.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/record_pattern_inside_case.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -114,10 +113,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/record_pattern_inside_case_empty.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/record_pattern_inside_case_empty.dart.intertwined.expect
index 9b8aef6..42cc740 100644
--- a/pkg/front_end/parser_testcases/patterns/record_pattern_inside_case_empty.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/record_pattern_inside_case_empty.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -88,10 +87,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/record_pattern_inside_case_singleton.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/record_pattern_inside_case_singleton.dart.intertwined.expect
index 7ab769e..2772d91 100644
--- a/pkg/front_end/parser_testcases/patterns/record_pattern_inside_case_singleton.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/record_pattern_inside_case_singleton.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -102,10 +101,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/record_pattern_inside_cast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/record_pattern_inside_cast.dart.intertwined.expect
index 884cf89..1a652f0 100644
--- a/pkg/front_end/parser_testcases/patterns/record_pattern_inside_cast.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/record_pattern_inside_cast.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -121,10 +120,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/record_pattern_inside_null_assert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/record_pattern_inside_null_assert.dart.intertwined.expect
index c00bad4..db40d7c 100644
--- a/pkg/front_end/parser_testcases/patterns/record_pattern_inside_null_assert.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/record_pattern_inside_null_assert.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -115,10 +114,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/record_pattern_inside_null_check.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/record_pattern_inside_null_check.dart.intertwined.expect
index 36b1256..0f804b4 100644
--- a/pkg/front_end/parser_testcases/patterns/record_pattern_inside_null_check.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/record_pattern_inside_null_check.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -115,10 +114,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/relational_containingBitwiseOrExpression_equality.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/relational_containingBitwiseOrExpression_equality.dart.intertwined.expect
index c861164..a7ad457 100644
--- a/pkg/front_end/parser_testcases/patterns/relational_containingBitwiseOrExpression_equality.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/relational_containingBitwiseOrExpression_equality.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -97,10 +96,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/relational_containingBitwiseOrExpression_relational.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/relational_containingBitwiseOrExpression_relational.dart.intertwined.expect
index 764b7fc..b978941 100644
--- a/pkg/front_end/parser_testcases/patterns/relational_containingBitwiseOrExpression_relational.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/relational_containingBitwiseOrExpression_relational.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -97,10 +96,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/relational_containingRelationalExpression_equality.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/relational_containingRelationalExpression_equality.dart.intertwined.expect
index 348df57..05031e0 100644
--- a/pkg/front_end/parser_testcases/patterns/relational_containingRelationalExpression_equality.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/relational_containingRelationalExpression_equality.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -99,7 +98,6 @@
                                   parseUnaryExpression(:, true, ConstantPatternContext.none)
                                     parsePrimary(:, expression, ConstantPatternContext.none)
                                       parseSend(:, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(:)
                                         ensureIdentifier(:, expression)
                                           reportRecoverableErrorWithToken(>, Template(ExpectedIdentifier))
                                             listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got '>'., Try inserting an identifier before '>'., {lexeme: >}], >, >)
@@ -135,7 +133,6 @@
                                   parseUnaryExpression(;, true, ConstantPatternContext.none)
                                     parsePrimary(;, expression, ConstantPatternContext.none)
                                       parseSend(;, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(;)
                                         ensureIdentifier(;, expression)
                                           reportRecoverableErrorWithToken(:, Template(ExpectedIdentifier))
                                             listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got ':'., Try inserting an identifier before ':'., {lexeme: :}], :, :)
@@ -161,10 +158,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 3, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/relational_containingRelationalExpression_relational.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/relational_containingRelationalExpression_relational.dart.intertwined.expect
index ecd64d8..ad32f2c 100644
--- a/pkg/front_end/parser_testcases/patterns/relational_containingRelationalExpression_relational.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/relational_containingRelationalExpression_relational.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -99,7 +98,6 @@
                                   parseUnaryExpression(:, true, ConstantPatternContext.none)
                                     parsePrimary(:, expression, ConstantPatternContext.none)
                                       parseSend(:, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(:)
                                         ensureIdentifier(:, expression)
                                           reportRecoverableErrorWithToken(>, Template(ExpectedIdentifier))
                                             listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got '>'., Try inserting an identifier before '>'., {lexeme: >}], >, >)
@@ -135,7 +133,6 @@
                                   parseUnaryExpression(;, true, ConstantPatternContext.none)
                                     parsePrimary(;, expression, ConstantPatternContext.none)
                                       parseSend(;, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(;)
                                         ensureIdentifier(;, expression)
                                           reportRecoverableErrorWithToken(:, Template(ExpectedIdentifier))
                                             listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got ':'., Try inserting an identifier before ':'., {lexeme: :}], :, :)
@@ -161,10 +158,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 3, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/relational_insideNullCheck_equal.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/relational_insideNullCheck_equal.dart.intertwined.expect
index 1a941d9..64b4fe9 100644
--- a/pkg/front_end/parser_testcases/patterns/relational_insideNullCheck_equal.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/relational_insideNullCheck_equal.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -93,10 +92,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/relational_insideNullCheck_greaterThan.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/relational_insideNullCheck_greaterThan.dart.intertwined.expect
index 888e856..ff56bda 100644
--- a/pkg/front_end/parser_testcases/patterns/relational_insideNullCheck_greaterThan.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/relational_insideNullCheck_greaterThan.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -93,10 +92,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/relational_inside_case_equal.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/relational_inside_case_equal.dart.intertwined.expect
index 9ec7670..eb54c13 100644
--- a/pkg/front_end/parser_testcases/patterns/relational_inside_case_equal.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/relational_inside_case_equal.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -100,10 +99,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/relational_inside_case_greater_than.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/relational_inside_case_greater_than.dart.intertwined.expect
index c2e6016..d0a27f5 100644
--- a/pkg/front_end/parser_testcases/patterns/relational_inside_case_greater_than.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/relational_inside_case_greater_than.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -100,10 +99,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/relational_inside_case_greater_than_or_equal.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/relational_inside_case_greater_than_or_equal.dart.intertwined.expect
index ba2a141..a2da40a 100644
--- a/pkg/front_end/parser_testcases/patterns/relational_inside_case_greater_than_or_equal.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/relational_inside_case_greater_than_or_equal.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -100,10 +99,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/relational_inside_case_less_than.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/relational_inside_case_less_than.dart.intertwined.expect
index ec75a62..11dc01a 100644
--- a/pkg/front_end/parser_testcases/patterns/relational_inside_case_less_than.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/relational_inside_case_less_than.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -100,10 +99,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/relational_inside_case_less_than_or_equal.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/relational_inside_case_less_than_or_equal.dart.intertwined.expect
index 0cd3d31..a28ca3b 100644
--- a/pkg/front_end/parser_testcases/patterns/relational_inside_case_less_than_or_equal.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/relational_inside_case_less_than_or_equal.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -100,10 +99,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/relational_inside_case_not_equal.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/relational_inside_case_not_equal.dart.intertwined.expect
index 424a08f..c3d49f5 100644
--- a/pkg/front_end/parser_testcases/patterns/relational_inside_case_not_equal.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/relational_inside_case_not_equal.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -100,10 +99,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/relational_inside_extractor_pattern.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/relational_inside_extractor_pattern.dart.intertwined.expect
index d112023..0ae36ab 100644
--- a/pkg/front_end/parser_testcases/patterns/relational_inside_extractor_pattern.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/relational_inside_extractor_pattern.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(C, DeclarationKind.Class, C)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, int)
+            notEofOrType(CLOSE_CURLY_BRACKET, int)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, C)
               parseMetadataStar({)
                 listener: beginMetadataStar(int)
@@ -42,7 +42,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -82,7 +82,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -98,7 +98,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -110,7 +109,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -148,10 +147,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/relational_inside_if_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/relational_inside_if_case.dart.intertwined.expect
index fad53d7..3b5ef06 100644
--- a/pkg/front_end/parser_testcases/patterns/relational_inside_if_case.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/relational_inside_if_case.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(case)
@@ -79,11 +78,11 @@
                     parseBlock(), BlockKind(statement))
                       ensureBlock(), BlockKind(statement))
                       listener: beginBlock({, BlockKind(statement))
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlock(0, {, }, BlockKind(statement))
                 listener: endThenStatement({, })
                 listener: endIfStatement(if, null, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/relational_inside_list_pattern.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/relational_inside_list_pattern.dart.intertwined.expect
index f40b95a..044779c 100644
--- a/pkg/front_end/parser_testcases/patterns/relational_inside_list_pattern.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/relational_inside_list_pattern.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -100,10 +99,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/relational_inside_logical_and_lhs.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/relational_inside_logical_and_lhs.dart.intertwined.expect
index 38c1bd2..46c514e 100644
--- a/pkg/front_end/parser_testcases/patterns/relational_inside_logical_and_lhs.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/relational_inside_logical_and_lhs.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -106,10 +105,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/relational_inside_logical_and_rhs.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/relational_inside_logical_and_rhs.dart.intertwined.expect
index e9010a2..775610b 100644
--- a/pkg/front_end/parser_testcases/patterns/relational_inside_logical_and_rhs.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/relational_inside_logical_and_rhs.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -106,10 +105,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/relational_inside_logical_or_lhs.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/relational_inside_logical_or_lhs.dart.intertwined.expect
index 3aedf49..8a8bd4e 100644
--- a/pkg/front_end/parser_testcases/patterns/relational_inside_logical_or_lhs.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/relational_inside_logical_or_lhs.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -106,10 +105,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/relational_inside_logical_or_rhs.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/relational_inside_logical_or_rhs.dart.intertwined.expect
index c17000f..795da60 100644
--- a/pkg/front_end/parser_testcases/patterns/relational_inside_logical_or_rhs.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/relational_inside_logical_or_rhs.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -106,10 +105,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/relational_inside_map_pattern.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/relational_inside_map_pattern.dart.intertwined.expect
index 26b18f6..5210d88 100644
--- a/pkg/front_end/parser_testcases/patterns/relational_inside_map_pattern.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/relational_inside_map_pattern.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -111,10 +110,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/relational_inside_parenthesized_pattern.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/relational_inside_parenthesized_pattern.dart.intertwined.expect
index ca17379..f0fc3b9 100644
--- a/pkg/front_end/parser_testcases/patterns/relational_inside_parenthesized_pattern.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/relational_inside_parenthesized_pattern.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -100,10 +99,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/relational_inside_record_pattern_named.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/relational_inside_record_pattern_named.dart.intertwined.expect
index 43eb951..afbac2e 100644
--- a/pkg/front_end/parser_testcases/patterns/relational_inside_record_pattern_named.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/relational_inside_record_pattern_named.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -115,10 +114,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/relational_inside_record_pattern_unnamed.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/relational_inside_record_pattern_unnamed.dart.intertwined.expect
index 5f65490..f111582 100644
--- a/pkg/front_end/parser_testcases/patterns/relational_inside_record_pattern_unnamed.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/relational_inside_record_pattern_unnamed.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -113,10 +112,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/rest_subpatternStartingTokens.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/rest_subpatternStartingTokens.dart.intertwined.expect
index 9616725..51abc67 100644
--- a/pkg/front_end/parser_testcases/patterns/rest_subpatternStartingTokens.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/rest_subpatternStartingTokens.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -388,7 +387,6 @@
                                 parsePrimary(..., expression, ConstantPatternContext.implicit)
                                   parseSendOrFunctionLiteral(..., expression, ConstantPatternContext.implicit)
                                     parseSend(..., expression, ConstantPatternContext.implicit)
-                                      isNextIdentifier(...)
                                       ensureIdentifier(..., expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments(])
@@ -420,7 +418,6 @@
                                   parseSendOrFunctionLiteral(const, expression, ConstantPatternContext.explicit)
                                     looksLikeFunctionBody(])
                                     parseSend(const, expression, ConstantPatternContext.explicit)
-                                      isNextIdentifier(const)
                                       ensureIdentifier(const, expression)
                                         listener: handleIdentifier(List, expression)
                                       listener: handleNoTypeArguments(()
@@ -676,10 +673,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 25, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/rest_withSubpattern_insideList.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/rest_withSubpattern_insideList.dart.intertwined.expect
index a198ca7..602053a 100644
--- a/pkg/front_end/parser_testcases/patterns/rest_withSubpattern_insideList.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/rest_withSubpattern_insideList.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -95,10 +94,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/rest_withSubpattern_insideMap.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/rest_withSubpattern_insideMap.dart.intertwined.expect
index 92f4b8e..e173d2d 100644
--- a/pkg/front_end/parser_testcases/patterns/rest_withSubpattern_insideMap.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/rest_withSubpattern_insideMap.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -95,10 +94,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/rest_withoutSubpattern_insideList.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/rest_withoutSubpattern_insideList.dart.intertwined.expect
index 5cd95fc..65e857e 100644
--- a/pkg/front_end/parser_testcases/patterns/rest_withoutSubpattern_insideList.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/rest_withoutSubpattern_insideList.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -88,10 +87,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/rest_withoutSubpattern_insideMap.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/rest_withoutSubpattern_insideMap.dart.intertwined.expect
index a75f42d..19ef3e3 100644
--- a/pkg/front_end/parser_testcases/patterns/rest_withoutSubpattern_insideMap.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/rest_withoutSubpattern_insideMap.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -88,10 +87,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/skipOuterPattern_eof.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/skipOuterPattern_eof.dart.intertwined.expect
index 685df3f..3206baf 100644
--- a/pkg/front_end/parser_testcases/patterns/skipOuterPattern_eof.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/skipOuterPattern_eof.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, int)
+          notEofOrType(CLOSE_CURLY_BRACKET, int)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -41,7 +41,6 @@
                         parsePrimary({, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                             parseSend({, expression, ConstantPatternContext.none)
-                              isNextIdentifier({)
                               ensureIdentifier({, expression)
                                 listener: handleIdentifier(int, expression)
                               listener: handleNoTypeArguments(var)
@@ -53,7 +52,7 @@
                       listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], int, int)
                     rewriter()
                   listener: handleExpressionStatement(int, ;)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(var, ;, null, var, null, null)
@@ -86,7 +85,7 @@
                     listener: endInitializedIdentifier()
                   ensureSemicolon(0)
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/string_literal_inside_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/string_literal_inside_case.dart.intertwined.expect
index 784451a..20f93a2 100644
--- a/pkg/front_end/parser_testcases/patterns/string_literal_inside_case.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/string_literal_inside_case.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -96,10 +95,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/string_literal_inside_cast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/string_literal_inside_cast.dart.intertwined.expect
index f252a3b..9d74231 100644
--- a/pkg/front_end/parser_testcases/patterns/string_literal_inside_cast.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/string_literal_inside_cast.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -103,10 +102,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/string_literal_inside_if_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/string_literal_inside_if_case.dart.intertwined.expect
index d520656..a16aa55 100644
--- a/pkg/front_end/parser_testcases/patterns/string_literal_inside_if_case.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/string_literal_inside_if_case.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(case)
@@ -82,11 +81,11 @@
                     parseBlock(), BlockKind(statement))
                       ensureBlock(), BlockKind(statement))
                       listener: beginBlock({, BlockKind(statement))
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlock(0, {, }, BlockKind(statement))
                 listener: endThenStatement({, })
                 listener: endIfStatement(if, null, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/string_literal_inside_null_assert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/string_literal_inside_null_assert.dart.intertwined.expect
index 006f9f9..c8c9f27 100644
--- a/pkg/front_end/parser_testcases/patterns/string_literal_inside_null_assert.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/string_literal_inside_null_assert.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -97,10 +96,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/string_literal_inside_null_check.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/string_literal_inside_null_check.dart.intertwined.expect
index b628656..5dfc8c8 100644
--- a/pkg/front_end/parser_testcases/patterns/string_literal_inside_null_check.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/string_literal_inside_null_check.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -97,10 +96,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/switchExpression_empty.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/switchExpression_empty.dart.intertwined.expect
index 140ec42..b37bbb1 100644
--- a/pkg/front_end/parser_testcases/patterns/switchExpression_empty.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/switchExpression_empty.dart.intertwined.expect
@@ -56,7 +56,6 @@
                                 parsePrimary((, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                     parseSend((, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(()
                                       ensureIdentifier((, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments())
diff --git a/pkg/front_end/parser_testcases/patterns/switchExpression_onePattern_guarded.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/switchExpression_onePattern_guarded.dart.intertwined.expect
index 0281bc0..fd42941 100644
--- a/pkg/front_end/parser_testcases/patterns/switchExpression_onePattern_guarded.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/switchExpression_onePattern_guarded.dart.intertwined.expect
@@ -56,7 +56,6 @@
                                 parsePrimary((, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                     parseSend((, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(()
                                       ensureIdentifier((, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments())
diff --git a/pkg/front_end/parser_testcases/patterns/switchExpression_onePattern_noTrailingComma.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/switchExpression_onePattern_noTrailingComma.dart.intertwined.expect
index 50442fc..895d93d 100644
--- a/pkg/front_end/parser_testcases/patterns/switchExpression_onePattern_noTrailingComma.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/switchExpression_onePattern_noTrailingComma.dart.intertwined.expect
@@ -56,7 +56,6 @@
                                 parsePrimary((, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                     parseSend((, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(()
                                       ensureIdentifier((, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments())
diff --git a/pkg/front_end/parser_testcases/patterns/switchExpression_onePattern_trailingComma.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/switchExpression_onePattern_trailingComma.dart.intertwined.expect
index 50442fc..895d93d 100644
--- a/pkg/front_end/parser_testcases/patterns/switchExpression_onePattern_trailingComma.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/switchExpression_onePattern_trailingComma.dart.intertwined.expect
@@ -56,7 +56,6 @@
                                 parsePrimary((, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                     parseSend((, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(()
                                       ensureIdentifier((, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments())
diff --git a/pkg/front_end/parser_testcases/patterns/switchExpression_recovery_bogusTokensAfterCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/switchExpression_recovery_bogusTokensAfterCase.dart.intertwined.expect
index 291664a..7f80433 100644
--- a/pkg/front_end/parser_testcases/patterns/switchExpression_recovery_bogusTokensAfterCase.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/switchExpression_recovery_bogusTokensAfterCase.dart.intertwined.expect
@@ -56,7 +56,6 @@
                                 parsePrimary((, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                     parseSend((, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(()
                                       ensureIdentifier((, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments())
diff --git a/pkg/front_end/parser_testcases/patterns/switchExpression_recovery_bogusTokensAfterCase_laterComma.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/switchExpression_recovery_bogusTokensAfterCase_laterComma.dart.intertwined.expect
index f5a9f5a..6b9e3eb 100644
--- a/pkg/front_end/parser_testcases/patterns/switchExpression_recovery_bogusTokensAfterCase_laterComma.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/switchExpression_recovery_bogusTokensAfterCase_laterComma.dart.intertwined.expect
@@ -64,7 +64,6 @@
                                           parsePrimary((, expression, ConstantPatternContext.none)
                                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                               parseSend((, expression, ConstantPatternContext.none)
-                                                isNextIdentifier(()
                                                 ensureIdentifier((, expression)
                                                   listener: handleIdentifier(x, expression)
                                                 listener: handleNoTypeArguments())
diff --git a/pkg/front_end/parser_testcases/patterns/switchExpression_recovery_bogusTokensAfterCase_nestedComma.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/switchExpression_recovery_bogusTokensAfterCase_nestedComma.dart.intertwined.expect
index 291664a..7f80433 100644
--- a/pkg/front_end/parser_testcases/patterns/switchExpression_recovery_bogusTokensAfterCase_nestedComma.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/switchExpression_recovery_bogusTokensAfterCase_nestedComma.dart.intertwined.expect
@@ -56,7 +56,6 @@
                                 parsePrimary((, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                     parseSend((, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(()
                                       ensureIdentifier((, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments())
diff --git a/pkg/front_end/parser_testcases/patterns/switchExpression_recovery_caseKeyword.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/switchExpression_recovery_caseKeyword.dart.intertwined.expect
index 3655dcc..087a608 100644
--- a/pkg/front_end/parser_testcases/patterns/switchExpression_recovery_caseKeyword.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/switchExpression_recovery_caseKeyword.dart.intertwined.expect
@@ -56,7 +56,6 @@
                                 parsePrimary((, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                     parseSend((, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(()
                                       ensureIdentifier((, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments())
diff --git a/pkg/front_end/parser_testcases/patterns/switchExpression_recovery_colonInsteadOfArrow.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/switchExpression_recovery_colonInsteadOfArrow.dart.intertwined.expect
index 136a49c..09b50cf 100644
--- a/pkg/front_end/parser_testcases/patterns/switchExpression_recovery_colonInsteadOfArrow.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/switchExpression_recovery_colonInsteadOfArrow.dart.intertwined.expect
@@ -56,7 +56,6 @@
                                 parsePrimary((, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                     parseSend((, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(()
                                       ensureIdentifier((, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments())
diff --git a/pkg/front_end/parser_testcases/patterns/switchExpression_recovery_defaultKeyword.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/switchExpression_recovery_defaultKeyword.dart.intertwined.expect
index 22166d5..c1c8c33 100644
--- a/pkg/front_end/parser_testcases/patterns/switchExpression_recovery_defaultKeyword.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/switchExpression_recovery_defaultKeyword.dart.intertwined.expect
@@ -56,7 +56,6 @@
                                 parsePrimary((, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                     parseSend((, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(()
                                       ensureIdentifier((, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments())
diff --git a/pkg/front_end/parser_testcases/patterns/switchExpression_recovery_illegalFunctionExpressionInGuard.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/switchExpression_recovery_illegalFunctionExpressionInGuard.dart.intertwined.expect
index daaba17..0644363 100644
--- a/pkg/front_end/parser_testcases/patterns/switchExpression_recovery_illegalFunctionExpressionInGuard.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/switchExpression_recovery_illegalFunctionExpressionInGuard.dart.intertwined.expect
@@ -56,7 +56,6 @@
                                 parsePrimary((, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                     parseSend((, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(()
                                       ensureIdentifier((, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments())
diff --git a/pkg/front_end/parser_testcases/patterns/switchExpression_recovery_illegalFunctionExpressionInGuard_semicolon.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/switchExpression_recovery_illegalFunctionExpressionInGuard_semicolon.dart.intertwined.expect
index b5ece91..c9de479 100644
--- a/pkg/front_end/parser_testcases/patterns/switchExpression_recovery_illegalFunctionExpressionInGuard_semicolon.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/switchExpression_recovery_illegalFunctionExpressionInGuard_semicolon.dart.intertwined.expect
@@ -56,7 +56,6 @@
                                 parsePrimary((, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                     parseSend((, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(()
                                       ensureIdentifier((, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments())
diff --git a/pkg/front_end/parser_testcases/patterns/switchExpression_recovery_missingComma.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/switchExpression_recovery_missingComma.dart.intertwined.expect
index 47f4e69..7b82f01 100644
--- a/pkg/front_end/parser_testcases/patterns/switchExpression_recovery_missingComma.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/switchExpression_recovery_missingComma.dart.intertwined.expect
@@ -56,7 +56,6 @@
                                 parsePrimary((, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                     parseSend((, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(()
                                       ensureIdentifier((, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments())
diff --git a/pkg/front_end/parser_testcases/patterns/switchExpression_recovery_semicolonInsteadOfComma.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/switchExpression_recovery_semicolonInsteadOfComma.dart.intertwined.expect
index 050e7af..ec5cc31 100644
--- a/pkg/front_end/parser_testcases/patterns/switchExpression_recovery_semicolonInsteadOfComma.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/switchExpression_recovery_semicolonInsteadOfComma.dart.intertwined.expect
@@ -56,7 +56,6 @@
                                 parsePrimary((, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                     parseSend((, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(()
                                       ensureIdentifier((, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments())
diff --git a/pkg/front_end/parser_testcases/patterns/switchExpression_recovery_unmatchedLessThanInTokensToBeSkipped.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/switchExpression_recovery_unmatchedLessThanInTokensToBeSkipped.dart.intertwined.expect
index 17e05cf..b8e2fac 100644
--- a/pkg/front_end/parser_testcases/patterns/switchExpression_recovery_unmatchedLessThanInTokensToBeSkipped.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/switchExpression_recovery_unmatchedLessThanInTokensToBeSkipped.dart.intertwined.expect
@@ -56,7 +56,6 @@
                                 parsePrimary((, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                     parseSend((, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(()
                                       ensureIdentifier((, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments())
diff --git a/pkg/front_end/parser_testcases/patterns/switchExpression_twoPatterns.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/switchExpression_twoPatterns.dart.intertwined.expect
index fcaea77..353a5ca 100644
--- a/pkg/front_end/parser_testcases/patterns/switchExpression_twoPatterns.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/switchExpression_twoPatterns.dart.intertwined.expect
@@ -56,7 +56,6 @@
                                 parsePrimary((, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                     parseSend((, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(()
                                       ensureIdentifier((, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments())
diff --git a/pkg/front_end/parser_testcases/patterns/syntheticIdentifier_insideListPattern.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/syntheticIdentifier_insideListPattern.dart.intertwined.expect
index 16e69f2..2614275 100644
--- a/pkg/front_end/parser_testcases/patterns/syntheticIdentifier_insideListPattern.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/syntheticIdentifier_insideListPattern.dart.intertwined.expect
@@ -37,7 +37,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -53,7 +53,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -65,7 +64,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -82,7 +81,6 @@
                                 parsePrimary([, expression, ConstantPatternContext.implicit)
                                   inPlainSync()
                                   parseSend([, expression, ConstantPatternContext.implicit)
-                                    isNextIdentifier([)
                                     ensureIdentifier([, expression)
                                       reportRecoverableErrorWithToken(if, Template(ExpectedIdentifier))
                                         listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got 'if'., Try inserting an identifier before 'if'., {lexeme: if}], if, if)
@@ -103,15 +101,15 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, ;)
+          notEofOrType(CLOSE_CURLY_BRACKET, ;)
           parseStatement(})
             parseStatementX(})
               parseEmptyStatement(})
                 listener: handleEmptyStatement(;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/syntheticIdentifier_insideMapPattern.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/syntheticIdentifier_insideMapPattern.dart.intertwined.expect
index 1af6d68..51b6ca3 100644
--- a/pkg/front_end/parser_testcases/patterns/syntheticIdentifier_insideMapPattern.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/syntheticIdentifier_insideMapPattern.dart.intertwined.expect
@@ -37,7 +37,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -53,7 +53,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -65,7 +64,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -90,7 +89,6 @@
                                 parsePrimary(:, expression, ConstantPatternContext.implicit)
                                   inPlainSync()
                                   parseSend(:, expression, ConstantPatternContext.implicit)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       reportRecoverableErrorWithToken(if, Template(ExpectedIdentifier))
                                         listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got 'if'., Try inserting an identifier before 'if'., {lexeme: if}], if, if)
@@ -115,7 +113,6 @@
                               parsePrimary(,, expression, ConstantPatternContext.none)
                                 inPlainSync()
                                 parseSend(,, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(,)
                                   ensureIdentifier(,, expression)
                                     reportRecoverableErrorWithToken(if, Template(ExpectedIdentifier))
                                       listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got 'if'., Try inserting an identifier before 'if'., {lexeme: if}], if, if)
@@ -138,7 +135,6 @@
                                 parsePrimary(:, expression, ConstantPatternContext.implicit)
                                   inPlainSync()
                                   parseSend(:, expression, ConstantPatternContext.implicit)
-                                    isNextIdentifier(:)
                                     ensureIdentifier(:, expression)
                                       reportRecoverableErrorWithToken(if, Template(ExpectedIdentifier))
                                         listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got 'if'., Try inserting an identifier before 'if'., {lexeme: if}], if, if)
@@ -160,15 +156,15 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, ;)
+          notEofOrType(CLOSE_CURLY_BRACKET, ;)
           parseStatement(})
             parseStatementX(})
               parseEmptyStatement(})
                 listener: handleEmptyStatement(;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/syntheticIdentifier_insideParenthesizedPattern.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/syntheticIdentifier_insideParenthesizedPattern.dart.intertwined.expect
index c6d7782..cfa5f0d 100644
--- a/pkg/front_end/parser_testcases/patterns/syntheticIdentifier_insideParenthesizedPattern.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/syntheticIdentifier_insideParenthesizedPattern.dart.intertwined.expect
@@ -37,7 +37,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -53,7 +53,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -65,7 +64,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -81,7 +80,6 @@
                                 parsePrimary((, expression, ConstantPatternContext.implicit)
                                   inPlainSync()
                                   parseSend((, expression, ConstantPatternContext.implicit)
-                                    isNextIdentifier(()
                                     ensureIdentifier((, expression)
                                       reportRecoverableErrorWithToken(if, Template(ExpectedIdentifier))
                                         listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got 'if'., Try inserting an identifier before 'if'., {lexeme: if}], if, if)
@@ -105,15 +103,15 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, ;)
+          notEofOrType(CLOSE_CURLY_BRACKET, ;)
           parseStatement(})
             parseStatementX(})
               parseEmptyStatement(})
                 listener: handleEmptyStatement(;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/syntheticIdentifier_insideRecordPattern.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/syntheticIdentifier_insideRecordPattern.dart.intertwined.expect
index c370264..f756673 100644
--- a/pkg/front_end/parser_testcases/patterns/syntheticIdentifier_insideRecordPattern.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/syntheticIdentifier_insideRecordPattern.dart.intertwined.expect
@@ -37,7 +37,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -53,7 +53,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -65,7 +64,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -89,7 +88,6 @@
                                 parsePrimary(,, expression, ConstantPatternContext.implicit)
                                   inPlainSync()
                                   parseSend(,, expression, ConstantPatternContext.implicit)
-                                    isNextIdentifier(,)
                                     ensureIdentifier(,, expression)
                                       reportRecoverableErrorWithToken(if, Template(ExpectedIdentifier))
                                         listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got 'if'., Try inserting an identifier before 'if'., {lexeme: if}], if, if)
@@ -114,15 +112,15 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, ;)
+          notEofOrType(CLOSE_CURLY_BRACKET, ;)
           parseStatement(})
             parseStatementX(})
               parseEmptyStatement(})
                 listener: handleEmptyStatement(;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/syntheticIdentifier_insideSwitchExpression.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/syntheticIdentifier_insideSwitchExpression.dart.intertwined.expect
index 04532ab..776d5d5 100644
--- a/pkg/front_end/parser_testcases/patterns/syntheticIdentifier_insideSwitchExpression.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/syntheticIdentifier_insideSwitchExpression.dart.intertwined.expect
@@ -57,7 +57,6 @@
                                 parsePrimary((, expression, ConstantPatternContext.none)
                                   parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                     parseSend((, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(()
                                       ensureIdentifier((, expression)
                                         listener: handleIdentifier(x, expression)
                                       listener: handleNoTypeArguments())
@@ -78,7 +77,6 @@
                               parsePrimary({, expression, ConstantPatternContext.implicit)
                                 inPlainSync()
                                 parseSend({, expression, ConstantPatternContext.implicit)
-                                  isNextIdentifier({)
                                   ensureIdentifier({, expression)
                                     reportRecoverableErrorWithToken(if, Template(ExpectedIdentifier))
                                       listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got 'if'., Try inserting an identifier before 'if'., {lexeme: if}], if, if)
@@ -104,7 +102,6 @@
                             parsePrimary(=>, expression, ConstantPatternContext.none)
                               inPlainSync()
                               parseSend(=>, expression, ConstantPatternContext.none)
-                                isNextIdentifier(=>)
                                 ensureIdentifier(=>, expression)
                                   reportRecoverableErrorWithToken(if, Template(ExpectedIdentifier))
                                     listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got 'if'., Try inserting an identifier before 'if'., {lexeme: if}], if, if)
diff --git a/pkg/front_end/parser_testcases/patterns/typeQuestionBeforeWhen_conditional.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/typeQuestionBeforeWhen_conditional.dart.intertwined.expect
index 21ccb20..0e33ecf 100644
--- a/pkg/front_end/parser_testcases/patterns/typeQuestionBeforeWhen_conditional.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/typeQuestionBeforeWhen_conditional.dart.intertwined.expect
@@ -65,7 +65,6 @@
                   parsePrimary(=>, expression, ConstantPatternContext.none)
                     parseSendOrFunctionLiteral(=>, expression, ConstantPatternContext.none)
                       parseSend(=>, expression, ConstantPatternContext.none)
-                        isNextIdentifier(=>)
                         ensureIdentifier(=>, expression)
                           listener: handleIdentifier(condition, expression)
                         listener: handleNoTypeArguments(as)
@@ -83,7 +82,6 @@
                               inPlainSync()
                               parseSendOrFunctionLiteral(?, expression, ConstantPatternContext.none)
                                 parseSend(?, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(?)
                                   ensureIdentifier(?, expression)
                                     inPlainSync()
                                   parseArgumentsOpt(when)
@@ -93,7 +91,6 @@
                             parsePrimary(:, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                                 parseSend(:, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(:)
                                   ensureIdentifier(:, expression)
                                   parseArgumentsOpt(otherwise)
                   listener: handleIdentifier(bool, typeReference)
@@ -111,7 +108,6 @@
                           inPlainSync()
                           parseSendOrFunctionLiteral(?, expression, ConstantPatternContext.none)
                             parseSend(?, expression, ConstantPatternContext.none)
-                              isNextIdentifier(?)
                               ensureIdentifier(?, expression)
                                 inPlainSync()
                                 listener: handleIdentifier(when, expression)
@@ -127,7 +123,6 @@
                         parsePrimary(:, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(:, expression, ConstantPatternContext.none)
                             parseSend(:, expression, ConstantPatternContext.none)
-                              isNextIdentifier(:)
                               ensureIdentifier(:, expression)
                                 listener: handleIdentifier(otherwise, expression)
                               listener: handleNoTypeArguments(;)
diff --git a/pkg/front_end/parser_testcases/patterns/typeQuestionBeforeWhen_guard.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/typeQuestionBeforeWhen_guard.dart.intertwined.expect
index 30dda61..0218cb7 100644
--- a/pkg/front_end/parser_testcases/patterns/typeQuestionBeforeWhen_guard.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/typeQuestionBeforeWhen_guard.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -82,7 +81,6 @@
                                 inPlainSync()
                                 parseSendOrFunctionLiteral(?, expression, ConstantPatternContext.none)
                                   parseSend(?, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(?)
                                     ensureIdentifier(?, expression)
                                       inPlainSync()
                                     parseArgumentsOpt(when)
@@ -102,7 +100,6 @@
                         parsePrimary(when, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(when, expression, ConstantPatternContext.none)
                             parseSend(when, expression, ConstantPatternContext.none)
-                              isNextIdentifier(when)
                               ensureIdentifier(when, expression)
                                 listener: handleIdentifier(x, expression)
                               listener: handleNoTypeArguments(==)
@@ -130,10 +127,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/typed_final_variable_inside_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/typed_final_variable_inside_case.dart.intertwined.expect
index bcaca37..e9a952d 100644
--- a/pkg/front_end/parser_testcases/patterns/typed_final_variable_inside_case.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/typed_final_variable_inside_case.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -92,10 +91,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/typed_final_variable_inside_cast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/typed_final_variable_inside_cast.dart.intertwined.expect
index 1d5e8f8..4c663f7 100644
--- a/pkg/front_end/parser_testcases/patterns/typed_final_variable_inside_cast.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/typed_final_variable_inside_cast.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -99,10 +98,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/typed_final_variable_inside_if_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/typed_final_variable_inside_if_case.dart.intertwined.expect
index 0c5b22d..838ea84 100644
--- a/pkg/front_end/parser_testcases/patterns/typed_final_variable_inside_if_case.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/typed_final_variable_inside_if_case.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(case)
@@ -78,11 +77,11 @@
                     parseBlock(), BlockKind(statement))
                       ensureBlock(), BlockKind(statement))
                       listener: beginBlock({, BlockKind(statement))
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlock(0, {, }, BlockKind(statement))
                 listener: endThenStatement({, })
                 listener: endIfStatement(if, null, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/typed_final_variable_inside_null_assert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/typed_final_variable_inside_null_assert.dart.intertwined.expect
index 6bedc3c..be14117 100644
--- a/pkg/front_end/parser_testcases/patterns/typed_final_variable_inside_null_assert.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/typed_final_variable_inside_null_assert.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -93,10 +92,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/typed_final_variable_inside_null_check.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/typed_final_variable_inside_null_check.dart.intertwined.expect
index e652a1d..f60346f 100644
--- a/pkg/front_end/parser_testcases/patterns/typed_final_variable_inside_null_check.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/typed_final_variable_inside_null_check.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -93,10 +92,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/typed_variable_inside_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/typed_variable_inside_case.dart.intertwined.expect
index 4b8883c..1bb720f 100644
--- a/pkg/front_end/parser_testcases/patterns/typed_variable_inside_case.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/typed_variable_inside_case.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -92,10 +91,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/typed_variable_inside_cast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/typed_variable_inside_cast.dart.intertwined.expect
index dfa85b5..b4c1372 100644
--- a/pkg/front_end/parser_testcases/patterns/typed_variable_inside_cast.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/typed_variable_inside_cast.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -99,10 +98,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/typed_variable_inside_if_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/typed_variable_inside_if_case.dart.intertwined.expect
index dee3b38..70cfe3a 100644
--- a/pkg/front_end/parser_testcases/patterns/typed_variable_inside_if_case.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/typed_variable_inside_if_case.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(case)
@@ -78,11 +77,11 @@
                     parseBlock(), BlockKind(statement))
                       ensureBlock(), BlockKind(statement))
                       listener: beginBlock({, BlockKind(statement))
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlock(0, {, }, BlockKind(statement))
                 listener: endThenStatement({, })
                 listener: endIfStatement(if, null, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/typed_variable_inside_null_assert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/typed_variable_inside_null_assert.dart.intertwined.expect
index f6ef89b..351e495 100644
--- a/pkg/front_end/parser_testcases/patterns/typed_variable_inside_null_assert.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/typed_variable_inside_null_assert.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -93,10 +92,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/typed_variable_inside_null_check.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/typed_variable_inside_null_check.dart.intertwined.expect
index 6463c513..18ca23a 100644
--- a/pkg/front_end/parser_testcases/patterns/typed_variable_inside_null_check.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/typed_variable_inside_null_check.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -93,10 +92,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/varKeywordInTypedVariablePattern_declarationContext.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/varKeywordInTypedVariablePattern_declarationContext.dart.intertwined.expect
index de376c2..af30620 100644
--- a/pkg/front_end/parser_testcases/patterns/varKeywordInTypedVariablePattern_declarationContext.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/varKeywordInTypedVariablePattern_declarationContext.dart.intertwined.expect
@@ -37,7 +37,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
@@ -72,7 +72,6 @@
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               ensureIdentifier(=, expression)
                                 listener: handleIdentifier(x, expression)
                               listener: handleNoTypeArguments(;)
@@ -81,7 +80,7 @@
                               listener: handleSend(x, x)
                   ensureSemicolon(x)
                   listener: handlePatternVariableDeclarationStatement(var, =, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/varKeywordInTypedVariablePattern_declarationContext_wildcard.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/varKeywordInTypedVariablePattern_declarationContext_wildcard.dart.intertwined.expect
index 28e64ac..b5ae7c4 100644
--- a/pkg/front_end/parser_testcases/patterns/varKeywordInTypedVariablePattern_declarationContext_wildcard.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/varKeywordInTypedVariablePattern_declarationContext_wildcard.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
@@ -70,7 +70,6 @@
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               ensureIdentifier(=, expression)
                                 listener: handleIdentifier(x, expression)
                               listener: handleNoTypeArguments(;)
@@ -79,7 +78,7 @@
                               listener: handleSend(x, x)
                   ensureSemicolon(x)
                   listener: handlePatternVariableDeclarationStatement(var, =, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/varKeywordInTypedVariablePattern_matchingContext.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/varKeywordInTypedVariablePattern_matchingContext.dart.intertwined.expect
index 704c761..7baac5a 100644
--- a/pkg/front_end/parser_testcases/patterns/varKeywordInTypedVariablePattern_matchingContext.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/varKeywordInTypedVariablePattern_matchingContext.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -91,10 +90,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/varKeywordInTypedVariablePattern_matchingContext_wildcard.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/varKeywordInTypedVariablePattern_matchingContext_wildcard.dart.intertwined.expect
index cc14284..0d88d2c 100644
--- a/pkg/front_end/parser_testcases/patterns/varKeywordInTypedVariablePattern_matchingContext_wildcard.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/varKeywordInTypedVariablePattern_matchingContext_wildcard.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -91,10 +90,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/var_variable_inside_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/var_variable_inside_case.dart.intertwined.expect
index bafdd4d..c63ce36 100644
--- a/pkg/front_end/parser_testcases/patterns/var_variable_inside_case.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/var_variable_inside_case.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -90,10 +89,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/var_variable_inside_cast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/var_variable_inside_cast.dart.intertwined.expect
index 2f4c8fe..c787edf 100644
--- a/pkg/front_end/parser_testcases/patterns/var_variable_inside_cast.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/var_variable_inside_cast.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -97,10 +96,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/var_variable_inside_if_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/var_variable_inside_if_case.dart.intertwined.expect
index 9be5ca8..8e3084c 100644
--- a/pkg/front_end/parser_testcases/patterns/var_variable_inside_if_case.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/var_variable_inside_if_case.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(case)
@@ -76,11 +75,11 @@
                     parseBlock(), BlockKind(statement))
                       ensureBlock(), BlockKind(statement))
                       listener: beginBlock({, BlockKind(statement))
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlock(0, {, }, BlockKind(statement))
                 listener: endThenStatement({, })
                 listener: endIfStatement(if, null, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/var_variable_inside_null_assert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/var_variable_inside_null_assert.dart.intertwined.expect
index d4b205d..7f255c7 100644
--- a/pkg/front_end/parser_testcases/patterns/var_variable_inside_null_assert.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/var_variable_inside_null_assert.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -91,10 +90,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/var_variable_inside_null_check.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/var_variable_inside_null_check.dart.intertwined.expect
index 403861a..ad9d99c 100644
--- a/pkg/front_end/parser_testcases/patterns/var_variable_inside_null_check.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/var_variable_inside_null_check.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -54,7 +54,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -66,7 +65,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -91,10 +90,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(test, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/variable_bare_insideCast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/variable_bare_insideCast.dart.intertwined.expect
index 752a006..48537d3 100644
--- a/pkg/front_end/parser_testcases/patterns/variable_bare_insideCast.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/variable_bare_insideCast.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
@@ -73,7 +73,6 @@
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               ensureIdentifier(=, expression)
                                 listener: handleIdentifier(x, expression)
                               listener: handleNoTypeArguments(;)
@@ -82,7 +81,7 @@
                               listener: handleSend(x, x)
                   ensureSemicolon(x)
                   listener: handlePatternVariableDeclarationStatement(var, =, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/variable_bare_insideNullAssert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/variable_bare_insideNullAssert.dart.intertwined.expect
index e54ab67..845c766 100644
--- a/pkg/front_end/parser_testcases/patterns/variable_bare_insideNullAssert.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/variable_bare_insideNullAssert.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
@@ -67,7 +67,6 @@
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               ensureIdentifier(=, expression)
                                 listener: handleIdentifier(x, expression)
                               listener: handleNoTypeArguments(;)
@@ -76,7 +75,7 @@
                               listener: handleSend(x, x)
                   ensureSemicolon(x)
                   listener: handlePatternVariableDeclarationStatement(var, =, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/variable_final_inDeclarationContext.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/variable_final_inDeclarationContext.dart.intertwined.expect
index 4bcf942..18aa6e3 100644
--- a/pkg/front_end/parser_testcases/patterns/variable_final_inDeclarationContext.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/variable_final_inDeclarationContext.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
@@ -68,7 +68,6 @@
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               ensureIdentifier(=, expression)
                                 listener: handleIdentifier(x, expression)
                               listener: handleNoTypeArguments(;)
@@ -77,7 +76,7 @@
                               listener: handleSend(x, x)
                   ensureSemicolon(x)
                   listener: handlePatternVariableDeclarationStatement(var, =, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/variable_namedAs.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/variable_namedAs.dart.intertwined.expect
index 20ac671..81112c8 100644
--- a/pkg/front_end/parser_testcases/patterns/variable_namedAs.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/variable_namedAs.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -82,10 +81,10 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/variable_namedWhen.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/variable_namedWhen.dart.intertwined.expect
index ebfa677..bd05cf1 100644
--- a/pkg/front_end/parser_testcases/patterns/variable_namedWhen.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/variable_namedWhen.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -82,10 +81,10 @@
                   parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
                     listener: beginSwitchCase(0, 1, case)
                     listener: endSwitchCase(0, 1, null, null, 0, case, :)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/variable_type_record_empty_inDeclarationContext.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/variable_type_record_empty_inDeclarationContext.dart.intertwined.expect
index b48bf9e..1cae315 100644
--- a/pkg/front_end/parser_testcases/patterns/variable_type_record_empty_inDeclarationContext.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/variable_type_record_empty_inDeclarationContext.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
@@ -68,7 +68,6 @@
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               ensureIdentifier(=, expression)
                                 listener: handleIdentifier(x, expression)
                               listener: handleNoTypeArguments(;)
@@ -77,7 +76,7 @@
                               listener: handleSend(x, x)
                   ensureSemicolon(x)
                   listener: handlePatternVariableDeclarationStatement(var, =, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/variable_type_record_empty_inMatchingContext.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/variable_type_record_empty_inMatchingContext.dart.intertwined.expect
index 466a324..24dbc05 100644
--- a/pkg/front_end/parser_testcases/patterns/variable_type_record_empty_inMatchingContext.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/variable_type_record_empty_inMatchingContext.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -89,10 +88,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/variable_type_record_nonEmpty_inDeclarationContext.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/variable_type_record_nonEmpty_inDeclarationContext.dart.intertwined.expect
index 3d823e2..11c2a47 100644
--- a/pkg/front_end/parser_testcases/patterns/variable_type_record_nonEmpty_inDeclarationContext.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/variable_type_record_nonEmpty_inDeclarationContext.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
@@ -88,7 +88,6 @@
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               ensureIdentifier(=, expression)
                                 listener: handleIdentifier(x, expression)
                               listener: handleNoTypeArguments(;)
@@ -97,7 +96,7 @@
                               listener: handleSend(x, x)
                   ensureSemicolon(x)
                   listener: handlePatternVariableDeclarationStatement(var, =, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/variable_type_record_nonEmpty_inMatchingContext.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/variable_type_record_nonEmpty_inMatchingContext.dart.intertwined.expect
index 74a899f..fdd25e6 100644
--- a/pkg/front_end/parser_testcases/patterns/variable_type_record_nonEmpty_inMatchingContext.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/variable_type_record_nonEmpty_inMatchingContext.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -109,10 +108,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/variable_var_inDeclarationContext.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/variable_var_inDeclarationContext.dart.intertwined.expect
index 6200c73..899c5f4 100644
--- a/pkg/front_end/parser_testcases/patterns/variable_var_inDeclarationContext.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/variable_var_inDeclarationContext.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
@@ -68,7 +68,6 @@
                         parsePrimary(=, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                             parseSend(=, expression, ConstantPatternContext.none)
-                              isNextIdentifier(=)
                               ensureIdentifier(=, expression)
                                 listener: handleIdentifier(x, expression)
                               listener: handleNoTypeArguments(;)
@@ -77,7 +76,7 @@
                               listener: handleSend(x, x)
                   ensureSemicolon(x)
                   listener: handlePatternVariableDeclarationStatement(var, =, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_bare_beforeWhen.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/wildcard_bare_beforeWhen.dart.intertwined.expect
index 7e781b1..a7480c0 100644
--- a/pkg/front_end/parser_testcases/patterns/wildcard_bare_beforeWhen.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/wildcard_bare_beforeWhen.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -96,10 +95,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_bare_insideCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/wildcard_bare_insideCase.dart.intertwined.expect
index 866b07320..a31055a 100644
--- a/pkg/front_end/parser_testcases/patterns/wildcard_bare_insideCase.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/wildcard_bare_insideCase.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -87,10 +86,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_bare_insideCast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/wildcard_bare_insideCast.dart.intertwined.expect
index e7bd874..366b8dd 100644
--- a/pkg/front_end/parser_testcases/patterns/wildcard_bare_insideCast.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/wildcard_bare_insideCast.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -94,10 +93,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_bare_insideIfCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/wildcard_bare_insideIfCase.dart.intertwined.expect
index 5bf2285..ec7280f9 100644
--- a/pkg/front_end/parser_testcases/patterns/wildcard_bare_insideIfCase.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/wildcard_bare_insideIfCase.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(case)
@@ -73,11 +72,11 @@
                     parseBlock(), BlockKind(statement))
                       ensureBlock(), BlockKind(statement))
                       listener: beginBlock({, BlockKind(statement))
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlock(0, {, }, BlockKind(statement))
                 listener: endThenStatement({, })
                 listener: endIfStatement(if, null, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_bare_insideNullAssert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/wildcard_bare_insideNullAssert.dart.intertwined.expect
index 14249ce..f95ea4b 100644
--- a/pkg/front_end/parser_testcases/patterns/wildcard_bare_insideNullAssert.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/wildcard_bare_insideNullAssert.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -88,10 +87,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_bare_insideNullCheck.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/wildcard_bare_insideNullCheck.dart.intertwined.expect
index db17e629..3865904 100644
--- a/pkg/front_end/parser_testcases/patterns/wildcard_bare_insideNullCheck.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/wildcard_bare_insideNullCheck.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -88,10 +87,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_final_typed_insideCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/wildcard_final_typed_insideCase.dart.intertwined.expect
index 528598a..61cd6b1 100644
--- a/pkg/front_end/parser_testcases/patterns/wildcard_final_typed_insideCase.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/wildcard_final_typed_insideCase.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -89,10 +88,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_final_typed_insideCast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/wildcard_final_typed_insideCast.dart.intertwined.expect
index c9d50c8..c73cd31 100644
--- a/pkg/front_end/parser_testcases/patterns/wildcard_final_typed_insideCast.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/wildcard_final_typed_insideCast.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -96,10 +95,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_final_typed_insideIfCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/wildcard_final_typed_insideIfCase.dart.intertwined.expect
index 31ce830..2523498 100644
--- a/pkg/front_end/parser_testcases/patterns/wildcard_final_typed_insideIfCase.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/wildcard_final_typed_insideIfCase.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(case)
@@ -75,11 +74,11 @@
                     parseBlock(), BlockKind(statement))
                       ensureBlock(), BlockKind(statement))
                       listener: beginBlock({, BlockKind(statement))
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlock(0, {, }, BlockKind(statement))
                 listener: endThenStatement({, })
                 listener: endIfStatement(if, null, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_final_typed_insideNullAssert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/wildcard_final_typed_insideNullAssert.dart.intertwined.expect
index 41e6371..868d09f 100644
--- a/pkg/front_end/parser_testcases/patterns/wildcard_final_typed_insideNullAssert.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/wildcard_final_typed_insideNullAssert.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -90,10 +89,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_final_typed_insideNullCheck.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/wildcard_final_typed_insideNullCheck.dart.intertwined.expect
index 4954503..471eee5 100644
--- a/pkg/front_end/parser_testcases/patterns/wildcard_final_typed_insideNullCheck.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/wildcard_final_typed_insideNullCheck.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -90,10 +89,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_final_untyped_insideCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/wildcard_final_untyped_insideCase.dart.intertwined.expect
index 0cc5695..47116c2 100644
--- a/pkg/front_end/parser_testcases/patterns/wildcard_final_untyped_insideCase.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/wildcard_final_untyped_insideCase.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -87,10 +86,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_final_untyped_insideCast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/wildcard_final_untyped_insideCast.dart.intertwined.expect
index 3e3b7a4..595aadb 100644
--- a/pkg/front_end/parser_testcases/patterns/wildcard_final_untyped_insideCast.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/wildcard_final_untyped_insideCast.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -94,10 +93,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_final_untyped_insideIfCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/wildcard_final_untyped_insideIfCase.dart.intertwined.expect
index f91c4fc..1e00719 100644
--- a/pkg/front_end/parser_testcases/patterns/wildcard_final_untyped_insideIfCase.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/wildcard_final_untyped_insideIfCase.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(case)
@@ -73,11 +72,11 @@
                     parseBlock(), BlockKind(statement))
                       ensureBlock(), BlockKind(statement))
                       listener: beginBlock({, BlockKind(statement))
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlock(0, {, }, BlockKind(statement))
                 listener: endThenStatement({, })
                 listener: endIfStatement(if, null, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_final_untyped_insideNullAssert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/wildcard_final_untyped_insideNullAssert.dart.intertwined.expect
index 88aa4a7..b2b135b 100644
--- a/pkg/front_end/parser_testcases/patterns/wildcard_final_untyped_insideNullAssert.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/wildcard_final_untyped_insideNullAssert.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -88,10 +87,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_final_untyped_insideNullCheck.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/wildcard_final_untyped_insideNullCheck.dart.intertwined.expect
index e28ff21..633c19a 100644
--- a/pkg/front_end/parser_testcases/patterns/wildcard_final_untyped_insideNullCheck.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/wildcard_final_untyped_insideNullCheck.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -88,10 +87,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_inPatternAssignment_bareIdentifier.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/wildcard_inPatternAssignment_bareIdentifier.dart.intertwined.expect
index bed9cbf..1e09ca5 100644
--- a/pkg/front_end/parser_testcases/patterns/wildcard_inPatternAssignment_bareIdentifier.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/wildcard_inPatternAssignment_bareIdentifier.dart.intertwined.expect
@@ -25,7 +25,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, [)
+          notEofOrType(CLOSE_CURLY_BRACKET, [)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -65,7 +65,6 @@
                               parsePrimary(=, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                   parseSend(=, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(=)
                                     ensureIdentifier(=, expression)
                                       listener: handleIdentifier(y, expression)
                                     listener: handleNoTypeArguments(;)
@@ -75,7 +74,7 @@
                         listener: handlePatternAssignment(=)
                     ensureSemicolon(y)
                     listener: handleExpressionStatement([, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_inPatternAssignment_usingFinal.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/wildcard_inPatternAssignment_usingFinal.dart.intertwined.expect
index 9d40637..1da16ed 100644
--- a/pkg/front_end/parser_testcases/patterns/wildcard_inPatternAssignment_usingFinal.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/wildcard_inPatternAssignment_usingFinal.dart.intertwined.expect
@@ -25,7 +25,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, [)
+          notEofOrType(CLOSE_CURLY_BRACKET, [)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -67,7 +67,6 @@
                               parsePrimary(=, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                   parseSend(=, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(=)
                                     ensureIdentifier(=, expression)
                                       listener: handleIdentifier(y, expression)
                                     listener: handleNoTypeArguments(;)
@@ -77,7 +76,7 @@
                         listener: handlePatternAssignment(=)
                     ensureSemicolon(y)
                     listener: handleExpressionStatement([, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_inPatternAssignment_usingFinalAndType.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/wildcard_inPatternAssignment_usingFinalAndType.dart.intertwined.expect
index c8aa574..95cb0e6 100644
--- a/pkg/front_end/parser_testcases/patterns/wildcard_inPatternAssignment_usingFinalAndType.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/wildcard_inPatternAssignment_usingFinalAndType.dart.intertwined.expect
@@ -25,7 +25,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, [)
+          notEofOrType(CLOSE_CURLY_BRACKET, [)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -69,7 +69,6 @@
                               parsePrimary(=, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                   parseSend(=, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(=)
                                     ensureIdentifier(=, expression)
                                       listener: handleIdentifier(y, expression)
                                     listener: handleNoTypeArguments(;)
@@ -79,7 +78,7 @@
                         listener: handlePatternAssignment(=)
                     ensureSemicolon(y)
                     listener: handleExpressionStatement([, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_inPatternAssignment_usingType.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/wildcard_inPatternAssignment_usingType.dart.intertwined.expect
index 516e38f..7c52dbf 100644
--- a/pkg/front_end/parser_testcases/patterns/wildcard_inPatternAssignment_usingType.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/wildcard_inPatternAssignment_usingType.dart.intertwined.expect
@@ -25,7 +25,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, [)
+          notEofOrType(CLOSE_CURLY_BRACKET, [)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -69,7 +69,6 @@
                               parsePrimary(=, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                   parseSend(=, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(=)
                                     ensureIdentifier(=, expression)
                                       listener: handleIdentifier(y, expression)
                                     listener: handleNoTypeArguments(;)
@@ -79,7 +78,7 @@
                         listener: handlePatternAssignment(=)
                     ensureSemicolon(y)
                     listener: handleExpressionStatement([, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_inPatternAssignment_usingVar.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/wildcard_inPatternAssignment_usingVar.dart.intertwined.expect
index 57b6f73..45a31b5 100644
--- a/pkg/front_end/parser_testcases/patterns/wildcard_inPatternAssignment_usingVar.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/wildcard_inPatternAssignment_usingVar.dart.intertwined.expect
@@ -25,7 +25,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, [)
+          notEofOrType(CLOSE_CURLY_BRACKET, [)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -67,7 +67,6 @@
                               parsePrimary(=, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                   parseSend(=, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(=)
                                     ensureIdentifier(=, expression)
                                       listener: handleIdentifier(y, expression)
                                     listener: handleNoTypeArguments(;)
@@ -77,7 +76,7 @@
                         listener: handlePatternAssignment(=)
                     ensureSemicolon(y)
                     listener: handleExpressionStatement([, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_inPatternAssignment_usingVarAndType.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/wildcard_inPatternAssignment_usingVarAndType.dart.intertwined.expect
index f6d0209..8c15d2b 100644
--- a/pkg/front_end/parser_testcases/patterns/wildcard_inPatternAssignment_usingVarAndType.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/wildcard_inPatternAssignment_usingVarAndType.dart.intertwined.expect
@@ -25,7 +25,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, [)
+          notEofOrType(CLOSE_CURLY_BRACKET, [)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -69,7 +69,6 @@
                               parsePrimary(=, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                   parseSend(=, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(=)
                                     ensureIdentifier(=, expression)
                                       listener: handleIdentifier(y, expression)
                                     listener: handleNoTypeArguments(;)
@@ -79,7 +78,7 @@
                         listener: handlePatternAssignment(=)
                     ensureSemicolon(y)
                     listener: handleExpressionStatement([, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_typed_insideCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/wildcard_typed_insideCase.dart.intertwined.expect
index ca9038b..4321b07 100644
--- a/pkg/front_end/parser_testcases/patterns/wildcard_typed_insideCase.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/wildcard_typed_insideCase.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -89,10 +88,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_typed_insideCast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/wildcard_typed_insideCast.dart.intertwined.expect
index 9f197bb..7e96f85 100644
--- a/pkg/front_end/parser_testcases/patterns/wildcard_typed_insideCast.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/wildcard_typed_insideCast.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -96,10 +95,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_typed_insideIfCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/wildcard_typed_insideIfCase.dart.intertwined.expect
index 683328b..ac9a904 100644
--- a/pkg/front_end/parser_testcases/patterns/wildcard_typed_insideIfCase.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/wildcard_typed_insideIfCase.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(case)
@@ -75,11 +74,11 @@
                     parseBlock(), BlockKind(statement))
                       ensureBlock(), BlockKind(statement))
                       listener: beginBlock({, BlockKind(statement))
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlock(0, {, }, BlockKind(statement))
                 listener: endThenStatement({, })
                 listener: endIfStatement(if, null, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_typed_insideNullAssert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/wildcard_typed_insideNullAssert.dart.intertwined.expect
index 2c8899e..1ec48cd 100644
--- a/pkg/front_end/parser_testcases/patterns/wildcard_typed_insideNullAssert.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/wildcard_typed_insideNullAssert.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -90,10 +89,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_typed_insideNullCheck.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/wildcard_typed_insideNullCheck.dart.intertwined.expect
index 8d925c4..d2fd71e 100644
--- a/pkg/front_end/parser_testcases/patterns/wildcard_typed_insideNullCheck.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/wildcard_typed_insideNullCheck.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -90,10 +89,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_var_insideCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/wildcard_var_insideCase.dart.intertwined.expect
index 4edc949..5564368b4 100644
--- a/pkg/front_end/parser_testcases/patterns/wildcard_var_insideCase.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/wildcard_var_insideCase.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -87,10 +86,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_var_insideCast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/wildcard_var_insideCast.dart.intertwined.expect
index 8f384bf..fbbea96 100644
--- a/pkg/front_end/parser_testcases/patterns/wildcard_var_insideCast.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/wildcard_var_insideCast.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -94,10 +93,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_var_insideIfCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/wildcard_var_insideIfCase.dart.intertwined.expect
index 5f4b847..dba2d57 100644
--- a/pkg/front_end/parser_testcases/patterns/wildcard_var_insideIfCase.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/wildcard_var_insideIfCase.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments(case)
@@ -73,11 +72,11 @@
                     parseBlock(), BlockKind(statement))
                       ensureBlock(), BlockKind(statement))
                       listener: beginBlock({, BlockKind(statement))
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlock(0, {, }, BlockKind(statement))
                 listener: endThenStatement({, })
                 listener: endIfStatement(if, null, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_var_insideNullAssert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/wildcard_var_insideNullAssert.dart.intertwined.expect
index 7826f7b..a45a614 100644
--- a/pkg/front_end/parser_testcases/patterns/wildcard_var_insideNullAssert.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/wildcard_var_insideNullAssert.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -88,10 +87,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_var_insideNullCheck.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/wildcard_var_insideNullCheck.dart.intertwined.expect
index 9bcfb9c64..b699e82 100644
--- a/pkg/front_end/parser_testcases/patterns/wildcard_var_insideNullCheck.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/patterns/wildcard_var_insideNullCheck.dart.intertwined.expect
@@ -35,7 +35,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, switch)
+          notEofOrType(CLOSE_CURLY_BRACKET, switch)
           parseStatement({)
             parseStatementX({)
               parseSwitchStatement({)
@@ -51,7 +51,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(x, expression)
                                 listener: handleNoTypeArguments())
@@ -63,7 +62,7 @@
                 parseSwitchBlock())
                   ensureBlock(), BlockKind(switch statement))
                   listener: beginSwitchBlock({)
-                  notEofOrValue(}, case)
+                  notEofOrType(CLOSE_CURLY_BRACKET, case)
                   peekPastLabels(case)
                   listener: beginCaseExpression(case)
                   parsePattern(case, PatternContext.matching, precedence: 1)
@@ -88,10 +87,10 @@
                           listener: handleBreakStatement(false, break, ;)
                     peekPastLabels(})
                     listener: endSwitchCase(0, 1, null, null, 1, case, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endSwitchBlock(1, {, })
                 listener: endSwitchStatement(switch, })
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/record/field_formal_parameter_with_explicit_record_type.dart.intertwined.expect b/pkg/front_end/parser_testcases/record/field_formal_parameter_with_explicit_record_type.dart.intertwined.expect
index 3a0bf60..da6ec3d 100644
--- a/pkg/front_end/parser_testcases/record/field_formal_parameter_with_explicit_record_type.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/record/field_formal_parameter_with_explicit_record_type.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(C, DeclarationKind.Class, C)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, C)
+            notEofOrType(CLOSE_CURLY_BRACKET, C)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, C)
               parseMetadataStar({)
                 listener: beginMetadataStar(C)
@@ -93,7 +93,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, C, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, C)
+            notEofOrType(CLOSE_CURLY_BRACKET, C)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, C)
               parseMetadataStar(;)
                 listener: beginMetadataStar(C)
@@ -165,7 +165,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, C, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, C)
+            notEofOrType(CLOSE_CURLY_BRACKET, C)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, C)
               parseMetadataStar(;)
                 listener: beginMetadataStar(C)
@@ -237,7 +237,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, C, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, C)
+            notEofOrType(CLOSE_CURLY_BRACKET, C)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, C)
               parseMetadataStar(;)
                 listener: beginMetadataStar(C)
@@ -305,7 +305,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, C, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, C)
+            notEofOrType(CLOSE_CURLY_BRACKET, C)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, C)
               parseMetadataStar(;)
                 listener: beginMetadataStar(C)
@@ -377,7 +377,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, C, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, C)
+            notEofOrType(CLOSE_CURLY_BRACKET, C)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, C)
               parseMetadataStar(;)
                 listener: beginMetadataStar(C)
@@ -449,7 +449,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, C, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 6, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/record/is_and_as.dart.intertwined.expect b/pkg/front_end/parser_testcases/record/is_and_as.dart.intertwined.expect
index bc4803b..1dbd7ae 100644
--- a/pkg/front_end/parser_testcases/record/is_and_as.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/record/is_and_as.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, final)
+          notEofOrType(CLOSE_CURLY_BRACKET, final)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(final, {, null, final, null, null)
@@ -60,7 +60,6 @@
                             parsePrimary(=, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                 parseSend(=, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(=)
                                   ensureIdentifier(=, expression)
                                     listener: handleIdentifier(a, expression)
                                   listener: handleNoTypeArguments(;)
@@ -71,7 +70,7 @@
                     listener: endInitializedIdentifier(b)
                   ensureSemicolon(a)
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement(;)
             parseStatementX(;)
               parseIfStatement(;)
@@ -84,7 +83,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(a, expression)
                                 listener: handleNoTypeArguments(is)
@@ -128,7 +126,7 @@
                     parseBlock(), BlockKind(statement))
                       ensureBlock(), BlockKind(statement))
                       listener: beginBlock({, BlockKind(statement))
-                      notEofOrValue(}, print)
+                      notEofOrType(CLOSE_CURLY_BRACKET, print)
                       parseStatement({)
                         parseStatementX({)
                           parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -141,7 +139,6 @@
                                       parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                                         looksLikeFunctionBody(;)
                                         parseSend({, expression, ConstantPatternContext.none)
-                                          isNextIdentifier({)
                                           ensureIdentifier({, expression)
                                             listener: handleIdentifier(print, expression)
                                           listener: handleNoTypeArguments(()
@@ -161,11 +158,11 @@
                                           listener: handleSend(print, ))
                               ensureSemicolon())
                               listener: handleExpressionStatement(print, ;)
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlock(1, {, }, BlockKind(statement))
                 listener: endThenStatement({, })
                 listener: endIfStatement(if, null, })
-          notEofOrValue(}, final)
+          notEofOrType(CLOSE_CURLY_BRACKET, final)
           parseStatement(})
             parseStatementX(})
               parseExpressionStatementOrDeclarationAfterModifiers(final, }, null, final, null, null)
@@ -188,7 +185,6 @@
                               parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                 looksLikeFunctionBody(;)
                                 parseSend(=, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(=)
                                   ensureIdentifier(=, expression)
                                     listener: handleIdentifier(b, expression)
                                   listener: handleNoTypeArguments(as)
@@ -228,7 +224,7 @@
                     listener: endInitializedIdentifier(c)
                   ensureSemicolon())
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(3, {, })
         listener: endTopLevelMethod(foo, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/record/is_record_conditional_expression.dart.intertwined.expect b/pkg/front_end/parser_testcases/record/is_record_conditional_expression.dart.intertwined.expect
index bc1f021..2287295 100644
--- a/pkg/front_end/parser_testcases/record/is_record_conditional_expression.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/record/is_record_conditional_expression.dart.intertwined.expect
@@ -38,7 +38,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, final)
+          notEofOrType(CLOSE_CURLY_BRACKET, final)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(final, {, null, final, null, null)
@@ -60,7 +60,6 @@
                             parsePrimary(=, expression, ConstantPatternContext.none)
                               parseSendOrFunctionLiteral(=, expression, ConstantPatternContext.none)
                                 parseSend(=, expression, ConstantPatternContext.none)
-                                  isNextIdentifier(=)
                                   ensureIdentifier(=, expression)
                                     listener: handleIdentifier(a, expression)
                                   listener: handleNoTypeArguments(is)
@@ -117,7 +116,7 @@
                     listener: endInitializedIdentifier(b)
                   ensureSemicolon(43)
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(foo, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/record/issue_52365.dart.intertwined.expect b/pkg/front_end/parser_testcases/record/issue_52365.dart.intertwined.expect
index 8f4d779..3d9138c 100644
--- a/pkg/front_end/parser_testcases/record/issue_52365.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/record/issue_52365.dart.intertwined.expect
@@ -25,7 +25,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
@@ -66,7 +66,6 @@
                                                 parseSendOrFunctionLiteral(=>, expression, ConstantPatternContext.none)
                                                   looksLikeFunctionBody(;)
                                                   parseSend(=>, expression, ConstantPatternContext.none)
-                                                    isNextIdentifier(=>)
                                                     ensureIdentifier(=>, expression)
                                                       listener: handleIdentifier(print, expression)
                                                     listener: handleNoTypeArguments(()
@@ -91,7 +90,7 @@
                     listener: endInitializedIdentifier(f0)
                   ensureSemicolon())
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, f0)
+          notEofOrType(CLOSE_CURLY_BRACKET, f0)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -103,7 +102,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(f0, expression)
                               listener: handleNoTypeArguments(>)
@@ -119,7 +117,7 @@
                       listener: endBinaryExpression(>, 42)
                   ensureSemicolon(42)
                   listener: handleExpressionStatement(f0, ;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -158,7 +156,6 @@
                                                           parseSendOrFunctionLiteral(=>, expression, ConstantPatternContext.none)
                                                             looksLikeFunctionBody())
                                                             parseSend(=>, expression, ConstantPatternContext.none)
-                                                              isNextIdentifier(=>)
                                                               ensureIdentifier(=>, expression)
                                                                 listener: handleIdentifier(print, expression)
                                                               listener: handleNoTypeArguments(()
@@ -190,7 +187,7 @@
                         listener: endBinaryExpression(>, 42)
                     ensureSemicolon(42)
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, f0)
+          notEofOrType(CLOSE_CURLY_BRACKET, f0)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -202,7 +199,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(f0, expression)
                               listener: handleNoTypeArguments(>>)
@@ -218,7 +214,7 @@
                       listener: endBinaryExpression(>>, 42)
                   ensureSemicolon(42)
                   listener: handleExpressionStatement(f0, ;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -257,7 +253,6 @@
                                                           parseSendOrFunctionLiteral(=>, expression, ConstantPatternContext.none)
                                                             looksLikeFunctionBody())
                                                             parseSend(=>, expression, ConstantPatternContext.none)
-                                                              isNextIdentifier(=>)
                                                               ensureIdentifier(=>, expression)
                                                                 listener: handleIdentifier(print, expression)
                                                               listener: handleNoTypeArguments(()
@@ -289,7 +284,7 @@
                         listener: endBinaryExpression(>>, 42)
                     ensureSemicolon(42)
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, f0)
+          notEofOrType(CLOSE_CURLY_BRACKET, f0)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -301,7 +296,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(f0, expression)
                               listener: handleNoTypeArguments(>>>)
@@ -317,7 +311,7 @@
                       listener: endBinaryExpression(>>>, 42)
                   ensureSemicolon(42)
                   listener: handleExpressionStatement(f0, ;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -356,7 +350,6 @@
                                                           parseSendOrFunctionLiteral(=>, expression, ConstantPatternContext.none)
                                                             looksLikeFunctionBody())
                                                             parseSend(=>, expression, ConstantPatternContext.none)
-                                                              isNextIdentifier(=>)
                                                               ensureIdentifier(=>, expression)
                                                                 listener: handleIdentifier(print, expression)
                                                               listener: handleNoTypeArguments(()
@@ -388,7 +381,7 @@
                         listener: endBinaryExpression(>>>, 42)
                     ensureSemicolon(42)
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(var, ;, null, var, null, null)
@@ -439,7 +432,6 @@
                                                 parseSendOrFunctionLiteral(=>, expression, ConstantPatternContext.none)
                                                   looksLikeFunctionBody(;)
                                                   parseSend(=>, expression, ConstantPatternContext.none)
-                                                    isNextIdentifier(=>)
                                                     ensureIdentifier(=>, expression)
                                                       listener: handleIdentifier(print, expression)
                                                     listener: handleNoTypeArguments(()
@@ -456,7 +448,6 @@
                                                                       listener: beginLiteralString("hello )
                                                                       parseIdentifierExpression($)
                                                                         parseSend($, expression, ConstantPatternContext.none)
-                                                                          isNextIdentifier($)
                                                                           ensureIdentifier($, expression)
                                                                             listener: handleIdentifier(x, expression)
                                                                           listener: handleNoTypeArguments(")
@@ -476,7 +467,7 @@
                     listener: endInitializedIdentifier(f1)
                   ensureSemicolon())
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, f1)
+          notEofOrType(CLOSE_CURLY_BRACKET, f1)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -488,7 +479,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(f1, expression)
                               listener: handleNoTypeArguments(>)
@@ -504,7 +494,7 @@
                       listener: endBinaryExpression(>, 42)
                   ensureSemicolon(42)
                   listener: handleExpressionStatement(f1, ;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -553,7 +543,6 @@
                                                           parseSendOrFunctionLiteral(=>, expression, ConstantPatternContext.none)
                                                             looksLikeFunctionBody())
                                                             parseSend(=>, expression, ConstantPatternContext.none)
-                                                              isNextIdentifier(=>)
                                                               ensureIdentifier(=>, expression)
                                                                 listener: handleIdentifier(print, expression)
                                                               listener: handleNoTypeArguments(()
@@ -570,7 +559,6 @@
                                                                                 listener: beginLiteralString("hello )
                                                                                 parseIdentifierExpression($)
                                                                                   parseSend($, expression, ConstantPatternContext.none)
-                                                                                    isNextIdentifier($)
                                                                                     ensureIdentifier($, expression)
                                                                                       listener: handleIdentifier(x, expression)
                                                                                     listener: handleNoTypeArguments(")
@@ -597,7 +585,7 @@
                         listener: endBinaryExpression(>, 42)
                     ensureSemicolon(42)
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, f1)
+          notEofOrType(CLOSE_CURLY_BRACKET, f1)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -609,7 +597,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(f1, expression)
                               listener: handleNoTypeArguments(>>)
@@ -625,7 +612,7 @@
                       listener: endBinaryExpression(>>, 42)
                   ensureSemicolon(42)
                   listener: handleExpressionStatement(f1, ;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -674,7 +661,6 @@
                                                           parseSendOrFunctionLiteral(=>, expression, ConstantPatternContext.none)
                                                             looksLikeFunctionBody())
                                                             parseSend(=>, expression, ConstantPatternContext.none)
-                                                              isNextIdentifier(=>)
                                                               ensureIdentifier(=>, expression)
                                                                 listener: handleIdentifier(print, expression)
                                                               listener: handleNoTypeArguments(()
@@ -691,7 +677,6 @@
                                                                                 listener: beginLiteralString("hello )
                                                                                 parseIdentifierExpression($)
                                                                                   parseSend($, expression, ConstantPatternContext.none)
-                                                                                    isNextIdentifier($)
                                                                                     ensureIdentifier($, expression)
                                                                                       listener: handleIdentifier(x, expression)
                                                                                     listener: handleNoTypeArguments(")
@@ -718,7 +703,7 @@
                         listener: endBinaryExpression(>>, 42)
                     ensureSemicolon(42)
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, f1)
+          notEofOrType(CLOSE_CURLY_BRACKET, f1)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -730,7 +715,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(f1, expression)
                               listener: handleNoTypeArguments(>>>)
@@ -746,7 +730,7 @@
                       listener: endBinaryExpression(>>>, 42)
                   ensureSemicolon(42)
                   listener: handleExpressionStatement(f1, ;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -795,7 +779,6 @@
                                                           parseSendOrFunctionLiteral(=>, expression, ConstantPatternContext.none)
                                                             looksLikeFunctionBody())
                                                             parseSend(=>, expression, ConstantPatternContext.none)
-                                                              isNextIdentifier(=>)
                                                               ensureIdentifier(=>, expression)
                                                                 listener: handleIdentifier(print, expression)
                                                               listener: handleNoTypeArguments(()
@@ -812,7 +795,6 @@
                                                                                 listener: beginLiteralString("hello )
                                                                                 parseIdentifierExpression($)
                                                                                   parseSend($, expression, ConstantPatternContext.none)
-                                                                                    isNextIdentifier($)
                                                                                     ensureIdentifier($, expression)
                                                                                       listener: handleIdentifier(x, expression)
                                                                                     listener: handleNoTypeArguments(")
@@ -839,7 +821,7 @@
                         listener: endBinaryExpression(>>>, 42)
                     ensureSemicolon(42)
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(var, ;, null, var, null, null)
@@ -900,7 +882,6 @@
                                                 parseSendOrFunctionLiteral(=>, expression, ConstantPatternContext.none)
                                                   looksLikeFunctionBody(;)
                                                   parseSend(=>, expression, ConstantPatternContext.none)
-                                                    isNextIdentifier(=>)
                                                     ensureIdentifier(=>, expression)
                                                       listener: handleIdentifier(print, expression)
                                                     listener: handleNoTypeArguments(()
@@ -917,7 +898,6 @@
                                                                       listener: beginLiteralString("hello )
                                                                       parseIdentifierExpression($)
                                                                         parseSend($, expression, ConstantPatternContext.none)
-                                                                          isNextIdentifier($)
                                                                           ensureIdentifier($, expression)
                                                                             listener: handleIdentifier(x, expression)
                                                                           listener: handleNoTypeArguments( )
@@ -929,7 +909,6 @@
                                                                         listener: handleStringPart( )
                                                                       parseIdentifierExpression($)
                                                                         parseSend($, expression, ConstantPatternContext.none)
-                                                                          isNextIdentifier($)
                                                                           ensureIdentifier($, expression)
                                                                             listener: handleIdentifier(y, expression)
                                                                           listener: handleNoTypeArguments(")
@@ -949,7 +928,7 @@
                     listener: endInitializedIdentifier(f2)
                   ensureSemicolon())
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, f2)
+          notEofOrType(CLOSE_CURLY_BRACKET, f2)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -961,7 +940,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(f2, expression)
                               listener: handleNoTypeArguments(>)
@@ -977,7 +955,7 @@
                       listener: endBinaryExpression(>, 42)
                   ensureSemicolon(42)
                   listener: handleExpressionStatement(f2, ;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1036,7 +1014,6 @@
                                                           parseSendOrFunctionLiteral(=>, expression, ConstantPatternContext.none)
                                                             looksLikeFunctionBody())
                                                             parseSend(=>, expression, ConstantPatternContext.none)
-                                                              isNextIdentifier(=>)
                                                               ensureIdentifier(=>, expression)
                                                                 listener: handleIdentifier(print, expression)
                                                               listener: handleNoTypeArguments(()
@@ -1053,7 +1030,6 @@
                                                                                 listener: beginLiteralString("hello )
                                                                                 parseIdentifierExpression($)
                                                                                   parseSend($, expression, ConstantPatternContext.none)
-                                                                                    isNextIdentifier($)
                                                                                     ensureIdentifier($, expression)
                                                                                       listener: handleIdentifier(x, expression)
                                                                                     listener: handleNoTypeArguments( )
@@ -1065,7 +1041,6 @@
                                                                                   listener: handleStringPart( )
                                                                                 parseIdentifierExpression($)
                                                                                   parseSend($, expression, ConstantPatternContext.none)
-                                                                                    isNextIdentifier($)
                                                                                     ensureIdentifier($, expression)
                                                                                       listener: handleIdentifier(y, expression)
                                                                                     listener: handleNoTypeArguments(")
@@ -1092,7 +1067,7 @@
                         listener: endBinaryExpression(>, 42)
                     ensureSemicolon(42)
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, f2)
+          notEofOrType(CLOSE_CURLY_BRACKET, f2)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -1104,7 +1079,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(f2, expression)
                               listener: handleNoTypeArguments(>>)
@@ -1120,7 +1094,7 @@
                       listener: endBinaryExpression(>>, 42)
                   ensureSemicolon(42)
                   listener: handleExpressionStatement(f2, ;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1179,7 +1153,6 @@
                                                           parseSendOrFunctionLiteral(=>, expression, ConstantPatternContext.none)
                                                             looksLikeFunctionBody())
                                                             parseSend(=>, expression, ConstantPatternContext.none)
-                                                              isNextIdentifier(=>)
                                                               ensureIdentifier(=>, expression)
                                                                 listener: handleIdentifier(print, expression)
                                                               listener: handleNoTypeArguments(()
@@ -1196,7 +1169,6 @@
                                                                                 listener: beginLiteralString("hello )
                                                                                 parseIdentifierExpression($)
                                                                                   parseSend($, expression, ConstantPatternContext.none)
-                                                                                    isNextIdentifier($)
                                                                                     ensureIdentifier($, expression)
                                                                                       listener: handleIdentifier(x, expression)
                                                                                     listener: handleNoTypeArguments( )
@@ -1208,7 +1180,6 @@
                                                                                   listener: handleStringPart( )
                                                                                 parseIdentifierExpression($)
                                                                                   parseSend($, expression, ConstantPatternContext.none)
-                                                                                    isNextIdentifier($)
                                                                                     ensureIdentifier($, expression)
                                                                                       listener: handleIdentifier(y, expression)
                                                                                     listener: handleNoTypeArguments(")
@@ -1235,7 +1206,7 @@
                         listener: endBinaryExpression(>>, 42)
                     ensureSemicolon(42)
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, f2)
+          notEofOrType(CLOSE_CURLY_BRACKET, f2)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -1247,7 +1218,6 @@
                         parsePrimary(;, expression, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(f2, expression)
                               listener: handleNoTypeArguments(>>>)
@@ -1263,7 +1233,7 @@
                       listener: endBinaryExpression(>>>, 42)
                   ensureSemicolon(42)
                   listener: handleExpressionStatement(f2, ;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1322,7 +1292,6 @@
                                                           parseSendOrFunctionLiteral(=>, expression, ConstantPatternContext.none)
                                                             looksLikeFunctionBody())
                                                             parseSend(=>, expression, ConstantPatternContext.none)
-                                                              isNextIdentifier(=>)
                                                               ensureIdentifier(=>, expression)
                                                                 listener: handleIdentifier(print, expression)
                                                               listener: handleNoTypeArguments(()
@@ -1339,7 +1308,6 @@
                                                                                 listener: beginLiteralString("hello )
                                                                                 parseIdentifierExpression($)
                                                                                   parseSend($, expression, ConstantPatternContext.none)
-                                                                                    isNextIdentifier($)
                                                                                     ensureIdentifier($, expression)
                                                                                       listener: handleIdentifier(x, expression)
                                                                                     listener: handleNoTypeArguments( )
@@ -1351,7 +1319,6 @@
                                                                                   listener: handleStringPart( )
                                                                                 parseIdentifierExpression($)
                                                                                   parseSend($, expression, ConstantPatternContext.none)
-                                                                                    isNextIdentifier($)
                                                                                     ensureIdentifier($, expression)
                                                                                       listener: handleIdentifier(y, expression)
                                                                                     listener: handleNoTypeArguments(")
@@ -1378,7 +1345,7 @@
                         listener: endBinaryExpression(>>>, 42)
                     ensureSemicolon(42)
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1417,7 +1384,6 @@
                                                           parseSendOrFunctionLiteral(=>, expression, ConstantPatternContext.none)
                                                             looksLikeFunctionBody(,)
                                                             parseSend(=>, expression, ConstantPatternContext.none)
-                                                              isNextIdentifier(=>)
                                                               ensureIdentifier(=>, expression)
                                                                 listener: handleIdentifier(print, expression)
                                                               listener: handleNoTypeArguments(()
@@ -1449,7 +1415,7 @@
                         listener: endBinaryExpression(>, 42)
                     ensureSemicolon(42)
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1488,7 +1454,6 @@
                                                           parseSendOrFunctionLiteral(=>, expression, ConstantPatternContext.none)
                                                             looksLikeFunctionBody(,)
                                                             parseSend(=>, expression, ConstantPatternContext.none)
-                                                              isNextIdentifier(=>)
                                                               ensureIdentifier(=>, expression)
                                                                 listener: handleIdentifier(print, expression)
                                                               listener: handleNoTypeArguments(()
@@ -1520,7 +1485,7 @@
                         listener: endBinaryExpression(>>, 42)
                     ensureSemicolon(42)
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1559,7 +1524,6 @@
                                                           parseSendOrFunctionLiteral(=>, expression, ConstantPatternContext.none)
                                                             looksLikeFunctionBody(,)
                                                             parseSend(=>, expression, ConstantPatternContext.none)
-                                                              isNextIdentifier(=>)
                                                               ensureIdentifier(=>, expression)
                                                                 listener: handleIdentifier(print, expression)
                                                               listener: handleNoTypeArguments(()
@@ -1591,7 +1555,7 @@
                         listener: endBinaryExpression(>>>, 42)
                     ensureSemicolon(42)
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1630,7 +1594,6 @@
                                                           parseSendOrFunctionLiteral(=>, expression, ConstantPatternContext.none)
                                                             looksLikeFunctionBody(,)
                                                             parseSend(=>, expression, ConstantPatternContext.none)
-                                                              isNextIdentifier(=>)
                                                               ensureIdentifier(=>, expression)
                                                                 listener: handleIdentifier(print, expression)
                                                               listener: handleNoTypeArguments(()
@@ -1676,7 +1639,6 @@
                                                           parseSendOrFunctionLiteral(=>, expression, ConstantPatternContext.none)
                                                             looksLikeFunctionBody())
                                                             parseSend(=>, expression, ConstantPatternContext.none)
-                                                              isNextIdentifier(=>)
                                                               ensureIdentifier(=>, expression)
                                                                 listener: handleIdentifier(print, expression)
                                                               listener: handleNoTypeArguments(()
@@ -1708,7 +1670,7 @@
                         listener: endBinaryExpression(>, 42)
                     ensureSemicolon(42)
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1747,7 +1709,6 @@
                                                           parseSendOrFunctionLiteral(=>, expression, ConstantPatternContext.none)
                                                             looksLikeFunctionBody(,)
                                                             parseSend(=>, expression, ConstantPatternContext.none)
-                                                              isNextIdentifier(=>)
                                                               ensureIdentifier(=>, expression)
                                                                 listener: handleIdentifier(print, expression)
                                                               listener: handleNoTypeArguments(()
@@ -1793,7 +1754,6 @@
                                                           parseSendOrFunctionLiteral(=>, expression, ConstantPatternContext.none)
                                                             looksLikeFunctionBody())
                                                             parseSend(=>, expression, ConstantPatternContext.none)
-                                                              isNextIdentifier(=>)
                                                               ensureIdentifier(=>, expression)
                                                                 listener: handleIdentifier(print, expression)
                                                               listener: handleNoTypeArguments(()
@@ -1825,7 +1785,7 @@
                         listener: endBinaryExpression(>>, 42)
                     ensureSemicolon(42)
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1864,7 +1824,6 @@
                                                           parseSendOrFunctionLiteral(=>, expression, ConstantPatternContext.none)
                                                             looksLikeFunctionBody(,)
                                                             parseSend(=>, expression, ConstantPatternContext.none)
-                                                              isNextIdentifier(=>)
                                                               ensureIdentifier(=>, expression)
                                                                 listener: handleIdentifier(print, expression)
                                                               listener: handleNoTypeArguments(()
@@ -1910,7 +1869,6 @@
                                                           parseSendOrFunctionLiteral(=>, expression, ConstantPatternContext.none)
                                                             looksLikeFunctionBody())
                                                             parseSend(=>, expression, ConstantPatternContext.none)
-                                                              isNextIdentifier(=>)
                                                               ensureIdentifier(=>, expression)
                                                                 listener: handleIdentifier(print, expression)
                                                               listener: handleNoTypeArguments(()
@@ -1942,7 +1900,7 @@
                         listener: endBinaryExpression(>>>, 42)
                     ensureSemicolon(42)
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(27, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -1961,7 +1919,7 @@
           listener: handleType(Function, null)
           parseClassOrMixinOrExtensionBody(Function, DeclarationKind.Extension, FunctionExtension)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Extension, {)
-            notEofOrValue(}, operator)
+            notEofOrType(CLOSE_CURLY_BRACKET, operator)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Extension, FunctionExtension)
               parseMetadataStar({)
                 listener: beginMetadataStar(operator)
@@ -1999,7 +1957,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, print)
+                  notEofOrType(CLOSE_CURLY_BRACKET, print)
                   parseStatement({)
                     parseStatementX({)
                       parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -2012,7 +1970,6 @@
                                   parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                                     looksLikeFunctionBody(;)
                                     parseSend({, expression, ConstantPatternContext.none)
-                                      isNextIdentifier({)
                                       ensureIdentifier({, expression)
                                         listener: handleIdentifier(print, expression)
                                       listener: handleNoTypeArguments(()
@@ -2029,7 +1986,6 @@
                                                         listener: beginLiteralString("You did > with ')
                                                         parseIdentifierExpression($)
                                                           parseSend($, expression, ConstantPatternContext.none)
-                                                            isNextIdentifier($)
                                                             ensureIdentifier($, expression)
                                                               listener: handleIdentifier(x, expression)
                                                             listener: handleNoTypeArguments(' on ')
@@ -2049,11 +2005,11 @@
                                       listener: handleSend(print, ))
                           ensureSemicolon())
                           listener: handleExpressionStatement(print, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endExtensionMethod(null, operator, (, null, })
               listener: endMember()
-            notEofOrValue(}, operator)
+            notEofOrType(CLOSE_CURLY_BRACKET, operator)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Extension, FunctionExtension)
               parseMetadataStar(})
                 listener: beginMetadataStar(operator)
@@ -2091,7 +2047,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, print)
+                  notEofOrType(CLOSE_CURLY_BRACKET, print)
                   parseStatement({)
                     parseStatementX({)
                       parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -2104,7 +2060,6 @@
                                   parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                                     looksLikeFunctionBody(;)
                                     parseSend({, expression, ConstantPatternContext.none)
-                                      isNextIdentifier({)
                                       ensureIdentifier({, expression)
                                         listener: handleIdentifier(print, expression)
                                       listener: handleNoTypeArguments(()
@@ -2121,7 +2076,6 @@
                                                         listener: beginLiteralString("You did >> with ')
                                                         parseIdentifierExpression($)
                                                           parseSend($, expression, ConstantPatternContext.none)
-                                                            isNextIdentifier($)
                                                             ensureIdentifier($, expression)
                                                               listener: handleIdentifier(x, expression)
                                                             listener: handleNoTypeArguments(' on ')
@@ -2141,11 +2095,11 @@
                                       listener: handleSend(print, ))
                           ensureSemicolon())
                           listener: handleExpressionStatement(print, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endExtensionMethod(null, operator, (, null, })
               listener: endMember()
-            notEofOrValue(}, operator)
+            notEofOrType(CLOSE_CURLY_BRACKET, operator)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Extension, FunctionExtension)
               parseMetadataStar(})
                 listener: beginMetadataStar(operator)
@@ -2183,7 +2137,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, print)
+                  notEofOrType(CLOSE_CURLY_BRACKET, print)
                   parseStatement({)
                     parseStatementX({)
                       parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -2196,7 +2150,6 @@
                                   parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                                     looksLikeFunctionBody(;)
                                     parseSend({, expression, ConstantPatternContext.none)
-                                      isNextIdentifier({)
                                       ensureIdentifier({, expression)
                                         listener: handleIdentifier(print, expression)
                                       listener: handleNoTypeArguments(()
@@ -2213,7 +2166,6 @@
                                                         listener: beginLiteralString("You did >>> with ')
                                                         parseIdentifierExpression($)
                                                           parseSend($, expression, ConstantPatternContext.none)
-                                                            isNextIdentifier($)
                                                             ensureIdentifier($, expression)
                                                               listener: handleIdentifier(x, expression)
                                                             listener: handleNoTypeArguments(' on ')
@@ -2233,11 +2185,11 @@
                                       listener: handleSend(print, ))
                           ensureSemicolon())
                           listener: handleExpressionStatement(print, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endExtensionMethod(null, operator, (, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Extension, 3, {, })
           listener: endExtensionDeclaration(extension, extension, on, })
   listener: endTopLevelDeclaration(})
@@ -2256,7 +2208,7 @@
           listener: handleType(Record, null)
           parseClassOrMixinOrExtensionBody(Record, DeclarationKind.Extension, RecordExtension)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Extension, {)
-            notEofOrValue(}, operator)
+            notEofOrType(CLOSE_CURLY_BRACKET, operator)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Extension, RecordExtension)
               parseMetadataStar({)
                 listener: beginMetadataStar(operator)
@@ -2294,7 +2246,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, print)
+                  notEofOrType(CLOSE_CURLY_BRACKET, print)
                   parseStatement({)
                     parseStatementX({)
                       parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -2307,7 +2259,6 @@
                                   parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                                     looksLikeFunctionBody(;)
                                     parseSend({, expression, ConstantPatternContext.none)
-                                      isNextIdentifier({)
                                       ensureIdentifier({, expression)
                                         listener: handleIdentifier(print, expression)
                                       listener: handleNoTypeArguments(()
@@ -2324,7 +2275,6 @@
                                                         listener: beginLiteralString("You did > with ')
                                                         parseIdentifierExpression($)
                                                           parseSend($, expression, ConstantPatternContext.none)
-                                                            isNextIdentifier($)
                                                             ensureIdentifier($, expression)
                                                               listener: handleIdentifier(x, expression)
                                                             listener: handleNoTypeArguments(' on ')
@@ -2344,11 +2294,11 @@
                                       listener: handleSend(print, ))
                           ensureSemicolon())
                           listener: handleExpressionStatement(print, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endExtensionMethod(null, operator, (, null, })
               listener: endMember()
-            notEofOrValue(}, operator)
+            notEofOrType(CLOSE_CURLY_BRACKET, operator)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Extension, RecordExtension)
               parseMetadataStar(})
                 listener: beginMetadataStar(operator)
@@ -2386,7 +2336,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, print)
+                  notEofOrType(CLOSE_CURLY_BRACKET, print)
                   parseStatement({)
                     parseStatementX({)
                       parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -2399,7 +2349,6 @@
                                   parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                                     looksLikeFunctionBody(;)
                                     parseSend({, expression, ConstantPatternContext.none)
-                                      isNextIdentifier({)
                                       ensureIdentifier({, expression)
                                         listener: handleIdentifier(print, expression)
                                       listener: handleNoTypeArguments(()
@@ -2416,7 +2365,6 @@
                                                         listener: beginLiteralString("You did >> with ')
                                                         parseIdentifierExpression($)
                                                           parseSend($, expression, ConstantPatternContext.none)
-                                                            isNextIdentifier($)
                                                             ensureIdentifier($, expression)
                                                               listener: handleIdentifier(x, expression)
                                                             listener: handleNoTypeArguments(' on ')
@@ -2436,11 +2384,11 @@
                                       listener: handleSend(print, ))
                           ensureSemicolon())
                           listener: handleExpressionStatement(print, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endExtensionMethod(null, operator, (, null, })
               listener: endMember()
-            notEofOrValue(}, operator)
+            notEofOrType(CLOSE_CURLY_BRACKET, operator)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Extension, RecordExtension)
               parseMetadataStar(})
                 listener: beginMetadataStar(operator)
@@ -2478,7 +2426,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, print)
+                  notEofOrType(CLOSE_CURLY_BRACKET, print)
                   parseStatement({)
                     parseStatementX({)
                       parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -2491,7 +2439,6 @@
                                   parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                                     looksLikeFunctionBody(;)
                                     parseSend({, expression, ConstantPatternContext.none)
-                                      isNextIdentifier({)
                                       ensureIdentifier({, expression)
                                         listener: handleIdentifier(print, expression)
                                       listener: handleNoTypeArguments(()
@@ -2508,7 +2455,6 @@
                                                         listener: beginLiteralString("You did >>> with ')
                                                         parseIdentifierExpression($)
                                                           parseSend($, expression, ConstantPatternContext.none)
-                                                            isNextIdentifier($)
                                                             ensureIdentifier($, expression)
                                                               listener: handleIdentifier(x, expression)
                                                             listener: handleNoTypeArguments(' on ')
@@ -2528,11 +2474,11 @@
                                       listener: handleSend(print, ))
                           ensureSemicolon())
                           listener: handleExpressionStatement(print, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endExtensionMethod(null, operator, (, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Extension, 3, {, })
           listener: endExtensionDeclaration(extension, extension, on, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/record/metadata.dart.intertwined.expect b/pkg/front_end/parser_testcases/record/metadata.dart.intertwined.expect
index 9420ba9..90b793a 100644
--- a/pkg/front_end/parser_testcases/record/metadata.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/record/metadata.dart.intertwined.expect
@@ -21,7 +21,6 @@
                     parsePrimary((, expression, ConstantPatternContext.none)
                       parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                         parseSend((, expression, ConstantPatternContext.none)
-                          isNextIdentifier(()
                           ensureIdentifier((, expression)
                             listener: handleIdentifier(x, expression)
                           listener: handleNoTypeArguments(,)
@@ -34,7 +33,6 @@
                     parsePrimary(,, expression, ConstantPatternContext.none)
                       parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                         parseSend(,, expression, ConstantPatternContext.none)
-                          isNextIdentifier(,)
                           ensureIdentifier(,, expression)
                             listener: handleIdentifier(y, expression)
                           listener: handleNoTypeArguments())
@@ -81,7 +79,6 @@
                     parsePrimary((, expression, ConstantPatternContext.none)
                       parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                         parseSend((, expression, ConstantPatternContext.none)
-                          isNextIdentifier(()
                           ensureIdentifier((, expression)
                             listener: handleIdentifier(x, expression)
                           listener: handleNoTypeArguments(,)
@@ -94,7 +91,6 @@
                     parsePrimary(,, expression, ConstantPatternContext.none)
                       parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                         parseSend(,, expression, ConstantPatternContext.none)
-                          isNextIdentifier(,)
                           ensureIdentifier(,, expression)
                             listener: handleIdentifier(y, expression)
                           listener: handleNoTypeArguments())
@@ -141,7 +137,6 @@
                     parsePrimary((, expression, ConstantPatternContext.none)
                       parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                         parseSend((, expression, ConstantPatternContext.none)
-                          isNextIdentifier(()
                           ensureIdentifier((, expression)
                             listener: handleIdentifier(x, expression)
                           listener: handleNoTypeArguments(,)
@@ -154,7 +149,6 @@
                     parsePrimary(,, expression, ConstantPatternContext.none)
                       parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                         parseSend(,, expression, ConstantPatternContext.none)
-                          isNextIdentifier(,)
                           ensureIdentifier(,, expression)
                             listener: handleIdentifier(y, expression)
                           listener: handleNoTypeArguments())
@@ -373,7 +367,6 @@
                     parsePrimary((, expression, ConstantPatternContext.none)
                       parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                         parseSend((, expression, ConstantPatternContext.none)
-                          isNextIdentifier(()
                           ensureIdentifier((, expression)
                             listener: handleIdentifier(x, expression)
                           listener: handleNoTypeArguments(,)
@@ -386,7 +379,6 @@
                     parsePrimary(,, expression, ConstantPatternContext.none)
                       parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                         parseSend(,, expression, ConstantPatternContext.none)
-                          isNextIdentifier(,)
                           ensureIdentifier(,, expression)
                             listener: handleIdentifier(y, expression)
                           listener: handleNoTypeArguments())
@@ -415,7 +407,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(C, DeclarationKind.Class, C)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -444,7 +436,6 @@
                     parsePrimary((, expression, ConstantPatternContext.none)
                       parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                         parseSend((, expression, ConstantPatternContext.none)
-                          isNextIdentifier(()
                           ensureIdentifier((, expression)
                             listener: handleIdentifier(x, expression)
                           listener: handleNoTypeArguments(,)
@@ -457,7 +448,6 @@
                     parsePrimary(,, expression, ConstantPatternContext.none)
                       parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                         parseSend(,, expression, ConstantPatternContext.none)
-                          isNextIdentifier(,)
                           ensureIdentifier(,, expression)
                             listener: handleIdentifier(y, expression)
                           listener: handleNoTypeArguments())
diff --git a/pkg/front_end/parser_testcases/record/modifier_before_type_question.dart.intertwined.expect b/pkg/front_end/parser_testcases/record/modifier_before_type_question.dart.intertwined.expect
index 372d5ab..6dbc805 100644
--- a/pkg/front_end/parser_testcases/record/modifier_before_type_question.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/record/modifier_before_type_question.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(abstract, class, null)
           parseClassOrMixinOrExtensionBody(Foo, DeclarationKind.Class, Foo)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, abstract)
+            notEofOrType(CLOSE_CURLY_BRACKET, abstract)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Foo)
               parseMetadataStar({)
                 listener: beginMetadataStar(abstract)
@@ -42,7 +42,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(abstract, null, null, null, null, null, null, 1, abstract, ;)
               listener: endMember()
-            notEofOrValue(}, abstract)
+            notEofOrType(CLOSE_CURLY_BRACKET, abstract)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(abstract)
@@ -59,7 +59,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(abstract, null, null, null, null, null, null, 1, abstract, ;)
               listener: endMember()
-            notEofOrValue(}, abstract)
+            notEofOrType(CLOSE_CURLY_BRACKET, abstract)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(abstract)
@@ -96,7 +96,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(abstract, null, null, null, null, null, null, 1, abstract, ;)
               listener: endMember()
-            notEofOrValue(}, abstract)
+            notEofOrType(CLOSE_CURLY_BRACKET, abstract)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(abstract)
@@ -133,7 +133,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(abstract, null, null, null, null, null, null, 1, abstract, ;)
               listener: endMember()
-            notEofOrValue(}, abstract)
+            notEofOrType(CLOSE_CURLY_BRACKET, abstract)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(abstract)
@@ -166,7 +166,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(abstract, null, null, null, null, null, null, 1, abstract, ;)
               listener: endMember()
-            notEofOrValue(}, abstract)
+            notEofOrType(CLOSE_CURLY_BRACKET, abstract)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(abstract)
@@ -199,7 +199,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(abstract, null, null, null, null, null, null, 1, abstract, ;)
               listener: endMember()
-            notEofOrValue(}, abstract)
+            notEofOrType(CLOSE_CURLY_BRACKET, abstract)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(abstract)
@@ -235,7 +235,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(abstract, null, null, null, null, null, null, 1, abstract, ;)
               listener: endMember()
-            notEofOrValue(}, abstract)
+            notEofOrType(CLOSE_CURLY_BRACKET, abstract)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(abstract)
@@ -271,7 +271,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(abstract, null, null, null, null, null, null, 1, abstract, ;)
               listener: endMember()
-            notEofOrValue(}, abstract)
+            notEofOrType(CLOSE_CURLY_BRACKET, abstract)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(abstract)
@@ -326,7 +326,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(abstract, null, null, null, null, null, null, 1, abstract, ;)
               listener: endMember()
-            notEofOrValue(}, abstract)
+            notEofOrType(CLOSE_CURLY_BRACKET, abstract)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(abstract)
@@ -381,7 +381,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(abstract, null, null, null, null, null, null, 1, abstract, ;)
               listener: endMember()
-            notEofOrValue(}, abstract)
+            notEofOrType(CLOSE_CURLY_BRACKET, abstract)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(abstract)
@@ -436,7 +436,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(abstract, null, null, null, null, null, null, 1, abstract, ;)
               listener: endMember()
-            notEofOrValue(}, abstract)
+            notEofOrType(CLOSE_CURLY_BRACKET, abstract)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(abstract)
@@ -491,7 +491,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(abstract, null, null, null, null, null, null, 1, abstract, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 12, {, })
           listener: endClassDeclaration(abstract, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/record/on.dart.intertwined.expect b/pkg/front_end/parser_testcases/record/on.dart.intertwined.expect
index 89ef712..ff7ac71 100644
--- a/pkg/front_end/parser_testcases/record/on.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/record/on.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, try)
+          notEofOrType(CLOSE_CURLY_BRACKET, try)
           parseStatement({)
             parseStatementX({)
               parseTryStatement({)
@@ -34,7 +34,7 @@
                 parseBlock(try, BlockKind(try statement))
                   ensureBlock(try, BlockKind(try statement))
                   listener: beginBlock({, BlockKind(try statement))
-                  notEofOrValue(}, print)
+                  notEofOrType(CLOSE_CURLY_BRACKET, print)
                   parseStatement({)
                     parseStatementX({)
                       parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -47,7 +47,6 @@
                                   parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                                     looksLikeFunctionBody(;)
                                     parseSend({, expression, ConstantPatternContext.none)
-                                      isNextIdentifier({)
                                       ensureIdentifier({, expression)
                                         listener: handleIdentifier(print, expression)
                                       listener: handleNoTypeArguments(()
@@ -65,7 +64,7 @@
                                       listener: handleSend(print, ))
                           ensureSemicolon())
                           listener: handleExpressionStatement(print, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlock(1, {, }, BlockKind(try statement))
                 listener: beginCatchClause(on)
                 listener: handleIdentifier(String, typeReference)
@@ -75,7 +74,7 @@
                 parseBlock(String, BlockKind(catch clause))
                   ensureBlock(String, BlockKind(catch clause))
                   listener: beginBlock({, BlockKind(catch clause))
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlock(0, {, }, BlockKind(catch clause))
                 listener: handleCatchBlock(on, null, null)
                 listener: beginCatchClause(on)
@@ -104,7 +103,7 @@
                 parseBlock(), BlockKind(catch clause))
                   ensureBlock(), BlockKind(catch clause))
                   listener: beginBlock({, BlockKind(catch clause))
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlock(0, {, }, BlockKind(catch clause))
                 listener: handleCatchBlock(on, null, null)
                 listener: beginCatchClause(on)
@@ -120,16 +119,16 @@
                       rewriter()
                       rewriter()
                   listener: beginBlock({, BlockKind(catch clause))
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlock(0, {, }, BlockKind(catch clause))
                 listener: handleCatchBlock(on, null, null)
                 listener: endTryStatement(3, try, null, })
-          notEofOrValue(}, ;)
+          notEofOrType(CLOSE_CURLY_BRACKET, ;)
           parseStatement(})
             parseStatementX(})
               parseEmptyStatement(})
                 listener: handleEmptyStatement(;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/record/operator_returning_record.dart.intertwined.expect b/pkg/front_end/parser_testcases/record/operator_returning_record.dart.intertwined.expect
index 653b9bb..496c04f 100644
--- a/pkg/front_end/parser_testcases/record/operator_returning_record.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/record/operator_returning_record.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Foo, DeclarationKind.Class, Foo)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, ()
+            notEofOrType(CLOSE_CURLY_BRACKET, ()
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Foo)
               parseMetadataStar({)
                 listener: beginMetadataStar(()
@@ -85,7 +85,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement({)
                     parseStatementX({)
                       parseReturnStatement({)
@@ -114,11 +114,11 @@
                         ensureSemicolon())
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(null, (, (, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -145,7 +145,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Bar, DeclarationKind.Class, Bar)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, ()
+            notEofOrType(CLOSE_CURLY_BRACKET, ()
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Bar)
               parseMetadataStar({)
                 listener: beginMetadataStar(()
@@ -205,7 +205,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement({)
                     parseStatementX({)
                       parseReturnStatement({)
@@ -234,11 +234,11 @@
                         ensureSemicolon())
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(null, (, (, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/record/record_and_commas.dart.intertwined.expect b/pkg/front_end/parser_testcases/record/record_and_commas.dart.intertwined.expect
index 6df8576..3e05ead 100644
--- a/pkg/front_end/parser_testcases/record/record_and_commas.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/record/record_and_commas.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -58,7 +58,7 @@
                       listener: endInitializedIdentifier(emptyRecord1)
                     ensureSemicolon())
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -92,7 +92,7 @@
                       listener: endInitializedIdentifier(emptyRecord2)
                     ensureSemicolon())
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -126,7 +126,7 @@
                       listener: endInitializedIdentifier(emptyRecord3)
                     ensureSemicolon())
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -162,7 +162,7 @@
                       listener: endInitializedIdentifier(emptyRecord4)
                     ensureSemicolon())
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -228,7 +228,6 @@
                                         parseUnaryExpression(,, true, ConstantPatternContext.none)
                                           parsePrimary(,, expression, ConstantPatternContext.none)
                                             parseSend(,, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(,)
                                               ensureIdentifier(,, expression)
                                                 reportRecoverableErrorWithToken(,, Template(ExpectedIdentifier))
                                                   listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got ','., Try inserting an identifier before ','., {lexeme: ,}], ,, ,)
@@ -244,7 +243,7 @@
                       listener: endInitializedIdentifier(emptyRecord5)
                     ensureSemicolon())
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -320,7 +319,6 @@
                                         parseUnaryExpression(,, true, ConstantPatternContext.none)
                                           parsePrimary(,, expression, ConstantPatternContext.none)
                                             parseSend(,, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(,)
                                               ensureIdentifier(,, expression)
                                                 reportRecoverableErrorWithToken(,, Template(ExpectedIdentifier))
                                                   listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got ','., Try inserting an identifier before ','., {lexeme: ,}], ,, ,)
@@ -336,7 +334,7 @@
                       listener: endInitializedIdentifier(emptyRecord6)
                     ensureSemicolon())
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -415,7 +413,6 @@
                                         parseUnaryExpression(,, true, ConstantPatternContext.none)
                                           parsePrimary(,, expression, ConstantPatternContext.none)
                                             parseSend(,, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(,)
                                               ensureIdentifier(,, expression)
                                                 reportRecoverableErrorWithToken(,, Template(ExpectedIdentifier))
                                                   listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got ','., Try inserting an identifier before ','., {lexeme: ,}], ,, ,)
@@ -430,7 +427,6 @@
                                         parseUnaryExpression(,, true, ConstantPatternContext.none)
                                           parsePrimary(,, expression, ConstantPatternContext.none)
                                             parseSend(,, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(,)
                                               ensureIdentifier(,, expression)
                                                 reportRecoverableErrorWithToken(,, Template(ExpectedIdentifier))
                                                   listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got ','., Try inserting an identifier before ','., {lexeme: ,}], ,, ,)
@@ -446,7 +442,7 @@
                       listener: endInitializedIdentifier(emptyRecord7)
                     ensureSemicolon())
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -535,7 +531,6 @@
                                         parseUnaryExpression(,, true, ConstantPatternContext.none)
                                           parsePrimary(,, expression, ConstantPatternContext.none)
                                             parseSend(,, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(,)
                                               ensureIdentifier(,, expression)
                                                 reportRecoverableErrorWithToken(,, Template(ExpectedIdentifier))
                                                   listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got ','., Try inserting an identifier before ','., {lexeme: ,}], ,, ,)
@@ -550,7 +545,6 @@
                                         parseUnaryExpression(,, true, ConstantPatternContext.none)
                                           parsePrimary(,, expression, ConstantPatternContext.none)
                                             parseSend(,, expression, ConstantPatternContext.none)
-                                              isNextIdentifier(,)
                                               ensureIdentifier(,, expression)
                                                 reportRecoverableErrorWithToken(,, Template(ExpectedIdentifier))
                                                   listener: handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got ','., Try inserting an identifier before ','., {lexeme: ,}], ,, ,)
@@ -566,7 +560,7 @@
                       listener: endInitializedIdentifier(emptyRecord8)
                     ensureSemicolon())
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(8, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/record/record_literal_01.dart.intertwined.expect b/pkg/front_end/parser_testcases/record/record_literal_01.dart.intertwined.expect
index e4cdfc2..ff51bc04 100644
--- a/pkg/front_end/parser_testcases/record/record_literal_01.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/record/record_literal_01.dart.intertwined.expect
@@ -25,7 +25,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
@@ -84,7 +84,7 @@
                     listener: endInitializedIdentifier(record1)
                   ensureSemicolon())
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(var, ;, null, var, null, null)
@@ -143,7 +143,7 @@
                     listener: endInitializedIdentifier(record2)
                   ensureSemicolon())
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, print)
+          notEofOrType(CLOSE_CURLY_BRACKET, print)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -156,7 +156,6 @@
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(print, expression)
                               listener: handleNoTypeArguments(()
@@ -170,7 +169,6 @@
                                           parsePrimary((, expression, ConstantPatternContext.none)
                                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                               parseSend((, expression, ConstantPatternContext.none)
-                                                isNextIdentifier(()
                                                 ensureIdentifier((, expression)
                                                   listener: handleIdentifier(record2, expression)
                                                 listener: handleNoTypeArguments(.)
@@ -180,7 +178,6 @@
                                         parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                             parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                              isNextIdentifier(.)
                                               ensureIdentifier(., expressionContinuation)
                                                 listener: handleIdentifier($1, expressionContinuation)
                                               listener: handleNoTypeArguments())
@@ -192,7 +189,7 @@
                               listener: handleSend(print, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(print, ;)
-          notEofOrValue(}, print)
+          notEofOrType(CLOSE_CURLY_BRACKET, print)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -205,7 +202,6 @@
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(print, expression)
                               listener: handleNoTypeArguments(()
@@ -219,7 +215,6 @@
                                           parsePrimary((, expression, ConstantPatternContext.none)
                                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                               parseSend((, expression, ConstantPatternContext.none)
-                                                isNextIdentifier(()
                                                 ensureIdentifier((, expression)
                                                   listener: handleIdentifier(record2, expression)
                                                 listener: handleNoTypeArguments(.)
@@ -229,7 +224,6 @@
                                         parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                             parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                              isNextIdentifier(.)
                                               ensureIdentifier(., expressionContinuation)
                                                 listener: handleIdentifier(a, expressionContinuation)
                                               listener: handleNoTypeArguments())
@@ -241,7 +235,7 @@
                               listener: handleSend(print, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(print, ;)
-          notEofOrValue(}, print)
+          notEofOrType(CLOSE_CURLY_BRACKET, print)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -254,7 +248,6 @@
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(print, expression)
                               listener: handleNoTypeArguments(()
@@ -268,7 +261,6 @@
                                           parsePrimary((, expression, ConstantPatternContext.none)
                                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                               parseSend((, expression, ConstantPatternContext.none)
-                                                isNextIdentifier(()
                                                 ensureIdentifier((, expression)
                                                   listener: handleIdentifier(record2, expression)
                                                 listener: handleNoTypeArguments(.)
@@ -278,7 +270,6 @@
                                         parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                             parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                              isNextIdentifier(.)
                                               ensureIdentifier(., expressionContinuation)
                                                 listener: handleIdentifier($2, expressionContinuation)
                                               listener: handleNoTypeArguments())
@@ -290,7 +281,7 @@
                               listener: handleSend(print, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(print, ;)
-          notEofOrValue(}, print)
+          notEofOrType(CLOSE_CURLY_BRACKET, print)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -303,7 +294,6 @@
                           parseSendOrFunctionLiteral(;, expression, ConstantPatternContext.none)
                             looksLikeFunctionBody(;)
                             parseSend(;, expression, ConstantPatternContext.none)
-                              isNextIdentifier(;)
                               ensureIdentifier(;, expression)
                                 listener: handleIdentifier(print, expression)
                               listener: handleNoTypeArguments(()
@@ -317,7 +307,6 @@
                                           parsePrimary((, expression, ConstantPatternContext.none)
                                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                               parseSend((, expression, ConstantPatternContext.none)
-                                                isNextIdentifier(()
                                                 ensureIdentifier((, expression)
                                                   listener: handleIdentifier(record2, expression)
                                                 listener: handleNoTypeArguments(.)
@@ -327,7 +316,6 @@
                                         parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                                           parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                                             parseSend(., expressionContinuation, ConstantPatternContext.none)
-                                              isNextIdentifier(.)
                                               ensureIdentifier(., expressionContinuation)
                                                 listener: handleIdentifier(b, expressionContinuation)
                                               listener: handleNoTypeArguments())
@@ -339,7 +327,7 @@
                               listener: handleSend(print, ))
                   ensureSemicolon())
                   listener: handleExpressionStatement(print, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(6, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/record/record_literal_02.dart.intertwined.expect b/pkg/front_end/parser_testcases/record/record_literal_02.dart.intertwined.expect
index e1427bd..60b6839 100644
--- a/pkg/front_end/parser_testcases/record/record_literal_02.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/record/record_literal_02.dart.intertwined.expect
@@ -25,7 +25,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -61,7 +61,7 @@
                                 listener: endRecordLiteral((, 3, null)
                     ensureSemicolon())
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -112,7 +112,7 @@
                                 listener: endRecordLiteral((, 4, null)
                     ensureSemicolon())
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -157,7 +157,7 @@
                                 listener: endRecordLiteral((, 2, null)
                     ensureSemicolon())
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -228,7 +228,7 @@
                                 listener: endRecordLiteral((, 2, null)
                     ensureSemicolon())
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(4, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/record/record_literal_03.dart.intertwined.expect b/pkg/front_end/parser_testcases/record/record_literal_03.dart.intertwined.expect
index 7ea4f94..ddc1420 100644
--- a/pkg/front_end/parser_testcases/record/record_literal_03.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/record/record_literal_03.dart.intertwined.expect
@@ -25,7 +25,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
@@ -60,7 +60,7 @@
                     listener: endInitializedIdentifier(r1)
                   ensureSemicolon())
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(var, ;, null, var, null, null)
@@ -98,7 +98,7 @@
                     listener: endInitializedIdentifier(r2)
                   ensureSemicolon())
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(var, ;, null, var, null, null)
@@ -136,7 +136,7 @@
                     listener: endInitializedIdentifier(r3)
                   ensureSemicolon())
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(var, ;, null, var, null, null)
@@ -171,7 +171,7 @@
                     listener: endInitializedIdentifier(r4)
                   ensureSemicolon())
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(4, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/record/record_literal_04.dart.intertwined.expect b/pkg/front_end/parser_testcases/record/record_literal_04.dart.intertwined.expect
index fb37958..e334014 100644
--- a/pkg/front_end/parser_testcases/record/record_literal_04.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/record/record_literal_04.dart.intertwined.expect
@@ -25,7 +25,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
@@ -62,7 +62,7 @@
                     listener: endInitializedIdentifier(r1)
                   ensureSemicolon())
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(var, ;, null, var, null, null)
@@ -123,7 +123,7 @@
                     listener: endInitializedIdentifier(r2)
                   ensureSemicolon())
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(var, ;, null, var, null, null)
@@ -184,7 +184,7 @@
                     listener: endInitializedIdentifier(r3)
                   ensureSemicolon())
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(var, ;, null, var, null, null)
@@ -224,7 +224,7 @@
                     listener: endInitializedIdentifier(r4)
                   ensureSemicolon())
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(var, ;, null, var, null, null)
@@ -263,7 +263,7 @@
                     listener: endInitializedIdentifier(r5)
                   ensureSemicolon())
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, var)
+          notEofOrType(CLOSE_CURLY_BRACKET, var)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(var, ;, null, var, null, null)
@@ -294,7 +294,7 @@
                     listener: endInitializedIdentifier(r6)
                   ensureSemicolon())
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(6, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -397,7 +397,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/record/record_type_01.dart.intertwined.expect b/pkg/front_end/parser_testcases/record/record_type_01.dart.intertwined.expect
index 459c1bc..c085c46 100644
--- a/pkg/front_end/parser_testcases/record/record_type_01.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/record/record_type_01.dart.intertwined.expect
@@ -25,7 +25,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -89,7 +89,7 @@
                       listener: endInitializedIdentifier(record1)
                     ensureSemicolon())
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -155,7 +155,7 @@
                       listener: endInitializedIdentifier(record1Named)
                     ensureSemicolon())
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -219,7 +219,7 @@
                       listener: endInitializedIdentifier(record2)
                     ensureSemicolon())
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -285,7 +285,7 @@
                       listener: endInitializedIdentifier(record2Named)
                     ensureSemicolon())
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -393,7 +393,7 @@
                       listener: endInitializedIdentifier(record3)
                     ensureSemicolon())
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -503,7 +503,7 @@
                       listener: endInitializedIdentifier(record3Named)
                     ensureSemicolon())
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -611,7 +611,7 @@
                       listener: endInitializedIdentifier(record4)
                     ensureSemicolon())
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -721,7 +721,7 @@
                       listener: endInitializedIdentifier(record4Named)
                     ensureSemicolon())
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, void)
+          notEofOrType(CLOSE_CURLY_BRACKET, void)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -770,7 +770,7 @@
                       listener: endInitializedIdentifier(foobar)
                     ensureSemicolon(foobar)
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -869,7 +869,7 @@
                       listener: endInitializedIdentifier(record5)
                     ensureSemicolon())
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, int)
+          notEofOrType(CLOSE_CURLY_BRACKET, int)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -923,7 +923,7 @@
                       inPlainSync()
                     parseFunctionBody(), false, false)
                       listener: beginBlockFunctionBody({)
-                      notEofOrValue(}, print)
+                      notEofOrType(CLOSE_CURLY_BRACKET, print)
                       parseStatement({)
                         parseStatementX({)
                           parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -936,7 +936,6 @@
                                       parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                                         looksLikeFunctionBody(;)
                                         parseSend({, expression, ConstantPatternContext.none)
-                                          isNextIdentifier({)
                                           ensureIdentifier({, expression)
                                             listener: handleIdentifier(print, expression)
                                           listener: handleNoTypeArguments(()
@@ -956,10 +955,10 @@
                                           listener: handleSend(print, ))
                               ensureSemicolon())
                               listener: handleExpressionStatement(print, ;)
-                      notEofOrValue(}, })
+                      notEofOrType(CLOSE_CURLY_BRACKET, })
                       listener: endBlockFunctionBody(1, {, })
                   listener: endLocalFunctionDeclaration(})
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(})
             parseStatementX(})
               parseExpressionStatementOrDeclaration(}, null)
@@ -1036,7 +1035,7 @@
                         inPlainSync()
                       parseFunctionBody(), false, false)
                         listener: beginBlockFunctionBody({)
-                        notEofOrValue(}, print)
+                        notEofOrType(CLOSE_CURLY_BRACKET, print)
                         parseStatement({)
                           parseStatementX({)
                             parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -1049,7 +1048,6 @@
                                         parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                                           looksLikeFunctionBody(;)
                                           parseSend({, expression, ConstantPatternContext.none)
-                                            isNextIdentifier({)
                                             ensureIdentifier({, expression)
                                               listener: handleIdentifier(print, expression)
                                             listener: handleNoTypeArguments(()
@@ -1069,10 +1067,10 @@
                                             listener: handleSend(print, ))
                                 ensureSemicolon())
                                 listener: handleExpressionStatement(print, ;)
-                        notEofOrValue(}, })
+                        notEofOrType(CLOSE_CURLY_BRACKET, })
                         listener: endBlockFunctionBody(1, {, })
                     listener: endLocalFunctionDeclaration(})
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(})
             parseStatementX(})
               parseExpressionStatementOrDeclaration(}, null)
@@ -1156,7 +1154,6 @@
                                   parseSendOrFunctionLiteral(=>, expression, ConstantPatternContext.none)
                                     looksLikeFunctionBody(;)
                                     parseSend(=>, expression, ConstantPatternContext.none)
-                                      isNextIdentifier(=>)
                                       ensureIdentifier(=>, expression)
                                         listener: handleIdentifier(print, expression)
                                       listener: handleNoTypeArguments(()
@@ -1178,7 +1175,7 @@
                           listener: handleExpressionFunctionBody(=>, ;)
                           inGenerator()
                     listener: endLocalFunctionDeclaration(;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1227,7 +1224,7 @@
                                     inPlainSync()
                                   parseFunctionBody(), true, false)
                                     listener: beginBlockFunctionBody({)
-                                    notEofOrValue(}, print)
+                                    notEofOrType(CLOSE_CURLY_BRACKET, print)
                                     parseStatement({)
                                       parseStatementX({)
                                         parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -1240,7 +1237,6 @@
                                                     parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                                                       looksLikeFunctionBody(;)
                                                       parseSend({, expression, ConstantPatternContext.none)
-                                                        isNextIdentifier({)
                                                         ensureIdentifier({, expression)
                                                           listener: handleIdentifier(print, expression)
                                                         listener: handleNoTypeArguments(()
@@ -1260,7 +1256,7 @@
                                                         listener: handleSend(print, ))
                                             ensureSemicolon())
                                             listener: handleExpressionStatement(print, ;)
-                                    notEofOrValue(}, })
+                                    notEofOrType(CLOSE_CURLY_BRACKET, })
                                     listener: endBlockFunctionBody(1, {, })
                                 listener: endFunctionExpression((, })
                         parseArgumentOrIndexStar(}, NoTypeParamOrArg(), false)
@@ -1272,7 +1268,7 @@
                           listener: handleSend((, ))
                     ensureSemicolon())
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1328,7 +1324,6 @@
                                               parseSendOrFunctionLiteral(=>, expression, ConstantPatternContext.none)
                                                 looksLikeFunctionBody(;)
                                                 parseSend(=>, expression, ConstantPatternContext.none)
-                                                  isNextIdentifier(=>)
                                                   ensureIdentifier(=>, expression)
                                                     listener: handleIdentifier(print, expression)
                                                   listener: handleNoTypeArguments(()
@@ -1351,7 +1346,7 @@
                                 listener: endFunctionExpression((, ))
                     ensureSemicolon())
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1400,7 +1395,7 @@
                                     inPlainSync()
                                   parseFunctionBody(async, true, false)
                                     listener: beginBlockFunctionBody({)
-                                    notEofOrValue(}, print)
+                                    notEofOrType(CLOSE_CURLY_BRACKET, print)
                                     parseStatement({)
                                       parseStatementX({)
                                         parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -1413,7 +1408,6 @@
                                                     parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                                                       looksLikeFunctionBody(;)
                                                       parseSend({, expression, ConstantPatternContext.none)
-                                                        isNextIdentifier({)
                                                         ensureIdentifier({, expression)
                                                           listener: handleIdentifier(print, expression)
                                                         listener: handleNoTypeArguments(()
@@ -1433,7 +1427,7 @@
                                                         listener: handleSend(print, ))
                                             ensureSemicolon())
                                             listener: handleExpressionStatement(print, ;)
-                                    notEofOrValue(}, })
+                                    notEofOrType(CLOSE_CURLY_BRACKET, })
                                     listener: endBlockFunctionBody(1, {, })
                                 listener: endFunctionExpression((, })
                         parseArgumentOrIndexStar(}, NoTypeParamOrArg(), false)
@@ -1445,7 +1439,7 @@
                           listener: handleSend((, ))
                     ensureSemicolon())
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -1501,7 +1495,6 @@
                                               parseSendOrFunctionLiteral(=>, expression, ConstantPatternContext.none)
                                                 looksLikeFunctionBody(;)
                                                 parseSend(=>, expression, ConstantPatternContext.none)
-                                                  isNextIdentifier(=>)
                                                   ensureIdentifier(=>, expression)
                                                     listener: handleIdentifier(print, expression)
                                                   listener: handleNoTypeArguments(()
@@ -1524,7 +1517,7 @@
                                 listener: endFunctionExpression((, ))
                     ensureSemicolon())
                     listener: handleExpressionStatement((, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(17, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/record/record_type_02.dart.intertwined.expect b/pkg/front_end/parser_testcases/record/record_type_02.dart.intertwined.expect
index 002760a..155110a 100644
--- a/pkg/front_end/parser_testcases/record/record_type_02.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/record/record_type_02.dart.intertwined.expect
@@ -25,7 +25,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -95,7 +95,7 @@
                       listener: endInitializedIdentifier(record1)
                     ensureSemicolon())
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -145,7 +145,7 @@
                       listener: endInitializedIdentifier(record2)
                     ensureSemicolon())
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -172,7 +172,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -220,7 +220,7 @@
                       listener: endInitializedIdentifier(record1)
                     ensureSemicolon())
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -276,7 +276,7 @@
                       listener: endInitializedIdentifier(record2)
                     ensureSemicolon())
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -308,7 +308,7 @@
                       listener: endInitializedIdentifier(record3)
                     ensureSemicolon())
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(3, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/record/record_type_03.dart.intertwined.expect b/pkg/front_end/parser_testcases/record/record_type_03.dart.intertwined.expect
index 25794c9..c061cd6 100644
--- a/pkg/front_end/parser_testcases/record/record_type_03.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/record/record_type_03.dart.intertwined.expect
@@ -96,7 +96,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -109,7 +109,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(inputRecord, expression)
                                 listener: handleNoTypeArguments(.)
@@ -119,7 +118,6 @@
                         parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                             parseSend(., expressionContinuation, ConstantPatternContext.none)
-                              isNextIdentifier(.)
                               ensureIdentifier(., expressionContinuation)
                                 listener: handleIdentifier(b, expressionContinuation)
                               listener: handleNoTypeArguments())
@@ -160,7 +158,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -189,7 +187,7 @@
                 ensureSemicolon())
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod((, null, })
   listener: endTopLevelDeclaration(})
@@ -275,7 +273,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, if)
+          notEofOrType(CLOSE_CURLY_BRACKET, if)
           parseStatement({)
             parseStatementX({)
               parseIfStatement({)
@@ -288,7 +286,6 @@
                           parsePrimary((, expression, ConstantPatternContext.none)
                             parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                               parseSend((, expression, ConstantPatternContext.none)
-                                isNextIdentifier(()
                                 ensureIdentifier((, expression)
                                   listener: handleIdentifier(inputRecord, expression)
                                 listener: handleNoTypeArguments(.)
@@ -298,7 +295,6 @@
                         parsePrimary(., expressionContinuation, ConstantPatternContext.none)
                           parseSendOrFunctionLiteral(., expressionContinuation, ConstantPatternContext.none)
                             parseSend(., expressionContinuation, ConstantPatternContext.none)
-                              isNextIdentifier(.)
                               ensureIdentifier(., expressionContinuation)
                                 listener: handleIdentifier(b, expressionContinuation)
                               listener: handleNoTypeArguments())
@@ -339,7 +335,7 @@
                       inGenerator()
                 listener: endThenStatement(return, ;)
                 listener: endIfStatement(if, null, ;)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement(;)
             parseStatementX(;)
               parseReturnStatement(;)
@@ -368,7 +364,7 @@
                 ensureSemicolon())
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(2, {, })
         listener: endTopLevelMethod((, null, })
   listener: endTopLevelDeclaration(})
@@ -395,7 +391,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Baz, DeclarationKind.Class, Baz)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, ()
+            notEofOrType(CLOSE_CURLY_BRACKET, ()
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Baz)
               parseMetadataStar({)
                 listener: beginMetadataStar(()
@@ -482,7 +478,7 @@
                     inGenerator()
                 listener: endClassMethod(null, (, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/record/record_type_04.dart.intertwined.expect b/pkg/front_end/parser_testcases/record/record_type_04.dart.intertwined.expect
index c2e2fea..1b8debc 100644
--- a/pkg/front_end/parser_testcases/record/record_type_04.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/record/record_type_04.dart.intertwined.expect
@@ -25,7 +25,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, Function)
+          notEofOrType(CLOSE_CURLY_BRACKET, Function)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -111,7 +111,7 @@
                       listener: endInitializedIdentifier(x)
                     ensureSemicolon(x)
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, int)
+          notEofOrType(CLOSE_CURLY_BRACKET, int)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -172,7 +172,7 @@
                     listener: endInitializedIdentifier(y1)
                   ensureSemicolon(y1)
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, int)
+          notEofOrType(CLOSE_CURLY_BRACKET, int)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -233,7 +233,7 @@
                     listener: endInitializedIdentifier(y2)
                   ensureSemicolon(y2)
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -314,7 +314,7 @@
                       listener: endInitializedIdentifier(z1)
                     ensureSemicolon(z1)
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -395,7 +395,7 @@
                       listener: endInitializedIdentifier(z2)
                     ensureSemicolon(z2)
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -494,7 +494,7 @@
                       listener: endInitializedIdentifier(z3)
                     ensureSemicolon(z3)
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, ()
+          notEofOrType(CLOSE_CURLY_BRACKET, ()
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclaration(;, null)
@@ -593,7 +593,7 @@
                       listener: endInitializedIdentifier(z4)
                     ensureSemicolon(z4)
                     listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(7, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/record/record_type_as_named_parameter.dart.intertwined.expect b/pkg/front_end/parser_testcases/record/record_type_as_named_parameter.dart.intertwined.expect
index bf899c6..2c7c322 100644
--- a/pkg/front_end/parser_testcases/record/record_type_as_named_parameter.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/record/record_type_as_named_parameter.dart.intertwined.expect
@@ -93,7 +93,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -234,7 +234,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -375,7 +375,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -470,7 +470,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -565,7 +565,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/record/record_type_as_optional_parameter.dart.intertwined.expect b/pkg/front_end/parser_testcases/record/record_type_as_optional_parameter.dart.intertwined.expect
index d622f7c..920fb94 100644
--- a/pkg/front_end/parser_testcases/record/record_type_as_optional_parameter.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/record/record_type_as_optional_parameter.dart.intertwined.expect
@@ -93,7 +93,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -234,7 +234,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
@@ -329,7 +329,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(0, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/record/record_type_as_type_arguments.dart.intertwined.expect b/pkg/front_end/parser_testcases/record/record_type_as_type_arguments.dart.intertwined.expect
index bff8379..f75241c 100644
--- a/pkg/front_end/parser_testcases/record/record_type_as_type_arguments.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/record/record_type_as_type_arguments.dart.intertwined.expect
@@ -25,7 +25,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, final)
+          notEofOrType(CLOSE_CURLY_BRACKET, final)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclarationAfterModifiers(final, {, null, final, null, null)
@@ -80,7 +80,7 @@
                     listener: endInitializedIdentifier(x)
                   ensureSemicolon(])
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, List)
+          notEofOrType(CLOSE_CURLY_BRACKET, List)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -137,7 +137,7 @@
                     listener: endInitializedIdentifier(y)
                   ensureSemicolon(])
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, Map)
+          notEofOrType(CLOSE_CURLY_BRACKET, Map)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -214,7 +214,7 @@
                     listener: endInitializedIdentifier(z)
                   ensureSemicolon(})
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, List)
+          notEofOrType(CLOSE_CURLY_BRACKET, List)
           parseStatement(;)
             parseStatementX(;)
               parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, null)
@@ -328,7 +328,7 @@
                     listener: endInitializedIdentifier(y2)
                   ensureSemicolon(])
                   listener: endVariablesDeclaration(1, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(4, {, })
         listener: endTopLevelMethod(void, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/record/record_type_getter.dart.intertwined.expect b/pkg/front_end/parser_testcases/record/record_type_getter.dart.intertwined.expect
index 6893cca..95be503 100644
--- a/pkg/front_end/parser_testcases/record/record_type_getter.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/record/record_type_getter.dart.intertwined.expect
@@ -148,7 +148,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement({)
             parseStatementX({)
               parseReturnStatement({)
@@ -179,7 +179,7 @@
                 ensureSemicolon())
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod((, null, })
   listener: endTopLevelDeclaration(})
@@ -317,7 +317,7 @@
           inPlainSync()
         parseFunctionBody(async, false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, throw)
+          notEofOrType(CLOSE_CURLY_BRACKET, throw)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -337,7 +337,7 @@
                         listener: handleThrowExpression(throw, "hello")
                     ensureSemicolon("hello")
                     listener: handleExpressionStatement(throw, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod((, null, })
   listener: endTopLevelDeclaration(})
@@ -476,7 +476,7 @@
           inPlainSync()
         parseFunctionBody(*, false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, throw)
+          notEofOrType(CLOSE_CURLY_BRACKET, throw)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -496,7 +496,7 @@
                         listener: handleThrowExpression(throw, "hello")
                     ensureSemicolon("hello")
                     listener: handleExpressionStatement(throw, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod((, null, })
   listener: endTopLevelDeclaration(})
@@ -635,7 +635,7 @@
           inPlainSync()
         parseFunctionBody(*, false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, throw)
+          notEofOrType(CLOSE_CURLY_BRACKET, throw)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -655,7 +655,7 @@
                         listener: handleThrowExpression(throw, "hello")
                     ensureSemicolon("hello")
                     listener: handleExpressionStatement(throw, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod((, null, })
   listener: endTopLevelDeclaration(})
@@ -775,7 +775,7 @@
         inPlainSync()
         parseFunctionBody(get, false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement({)
             parseStatementX({)
               parseReturnStatement({)
@@ -806,7 +806,7 @@
                 ensureSemicolon())
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod((, get, })
   listener: endTopLevelDeclaration(})
@@ -914,7 +914,7 @@
         inPlainSync()
         parseFunctionBody(async, false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, throw)
+          notEofOrType(CLOSE_CURLY_BRACKET, throw)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -934,7 +934,7 @@
                         listener: handleThrowExpression(throw, "hello")
                     ensureSemicolon("hello")
                     listener: handleExpressionStatement(throw, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod((, get, })
   listener: endTopLevelDeclaration(})
@@ -1043,7 +1043,7 @@
         inPlainSync()
         parseFunctionBody(*, false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, throw)
+          notEofOrType(CLOSE_CURLY_BRACKET, throw)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -1063,7 +1063,7 @@
                         listener: handleThrowExpression(throw, "hello")
                     ensureSemicolon("hello")
                     listener: handleExpressionStatement(throw, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod((, get, })
   listener: endTopLevelDeclaration(})
@@ -1172,7 +1172,7 @@
         inPlainSync()
         parseFunctionBody(*, false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, throw)
+          notEofOrType(CLOSE_CURLY_BRACKET, throw)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -1192,7 +1192,7 @@
                         listener: handleThrowExpression(throw, "hello")
                     ensureSemicolon("hello")
                     listener: handleExpressionStatement(throw, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod((, get, })
   listener: endTopLevelDeclaration(})
@@ -1312,7 +1312,7 @@
         inPlainSync()
         parseFunctionBody(topLevelGetter, false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement({)
             parseStatementX({)
               parseReturnStatement({)
@@ -1343,7 +1343,7 @@
                 ensureSemicolon())
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod((, get, })
   listener: endTopLevelDeclaration(})
@@ -1451,7 +1451,7 @@
         inPlainSync()
         parseFunctionBody(async, false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, throw)
+          notEofOrType(CLOSE_CURLY_BRACKET, throw)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -1471,7 +1471,7 @@
                         listener: handleThrowExpression(throw, "hello")
                     ensureSemicolon("hello")
                     listener: handleExpressionStatement(throw, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod((, get, })
   listener: endTopLevelDeclaration(})
@@ -1580,7 +1580,7 @@
         inPlainSync()
         parseFunctionBody(*, false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, throw)
+          notEofOrType(CLOSE_CURLY_BRACKET, throw)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -1600,7 +1600,7 @@
                         listener: handleThrowExpression(throw, "hello")
                     ensureSemicolon("hello")
                     listener: handleExpressionStatement(throw, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod((, get, })
   listener: endTopLevelDeclaration(})
@@ -1709,7 +1709,7 @@
         inPlainSync()
         parseFunctionBody(*, false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, throw)
+          notEofOrType(CLOSE_CURLY_BRACKET, throw)
           parseStatement({)
             parseStatementX({)
               parseExpressionStatementOrDeclaration({, null)
@@ -1729,7 +1729,7 @@
                         listener: handleThrowExpression(throw, "hello")
                     ensureSemicolon("hello")
                     listener: handleExpressionStatement(throw, ;)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod((, get, })
   listener: endTopLevelDeclaration(})
@@ -1756,7 +1756,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Foo, DeclarationKind.Class, Foo)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, ()
+            notEofOrType(CLOSE_CURLY_BRACKET, ()
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Foo)
               parseMetadataStar({)
                 listener: beginMetadataStar(()
@@ -1848,7 +1848,7 @@
                     inGenerator()
                 listener: endClassMethod(null, (, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, ()
+            notEofOrType(CLOSE_CURLY_BRACKET, ()
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(()
@@ -1912,7 +1912,7 @@
                 inPlainSync()
                 parseFunctionBody(), false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement({)
                     parseStatementX({)
                       parseReturnStatement({)
@@ -1943,11 +1943,11 @@
                         ensureSemicolon())
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(null, (, (, null, })
               listener: endMember()
-            notEofOrValue(}, ()
+            notEofOrType(CLOSE_CURLY_BRACKET, ()
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(()
@@ -2027,7 +2027,7 @@
                     inGenerator()
                 listener: endClassMethod(null, (, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, ()
+            notEofOrType(CLOSE_CURLY_BRACKET, ()
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(()
@@ -2091,7 +2091,7 @@
                 inPlainSync()
                 parseFunctionBody(async, false, false)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, throw)
+                  notEofOrType(CLOSE_CURLY_BRACKET, throw)
                   parseStatement({)
                     parseStatementX({)
                       parseExpressionStatementOrDeclaration({, null)
@@ -2111,11 +2111,11 @@
                                 listener: handleThrowExpression(throw, "hello")
                             ensureSemicolon("hello")
                             listener: handleExpressionStatement(throw, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(null, (, (, null, })
               listener: endMember()
-            notEofOrValue(}, ()
+            notEofOrType(CLOSE_CURLY_BRACKET, ()
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(()
@@ -2196,7 +2196,7 @@
                     listener: handleInvalidStatement(=>, GeneratorReturnsValue)
                 listener: endClassMethod(null, (, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, ()
+            notEofOrType(CLOSE_CURLY_BRACKET, ()
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(()
@@ -2260,7 +2260,7 @@
                 inPlainSync()
                 parseFunctionBody(*, false, false)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, throw)
+                  notEofOrType(CLOSE_CURLY_BRACKET, throw)
                   parseStatement({)
                     parseStatementX({)
                       parseExpressionStatementOrDeclaration({, null)
@@ -2280,11 +2280,11 @@
                                 listener: handleThrowExpression(throw, "hello")
                             ensureSemicolon("hello")
                             listener: handleExpressionStatement(throw, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(null, (, (, null, })
               listener: endMember()
-            notEofOrValue(}, ()
+            notEofOrType(CLOSE_CURLY_BRACKET, ()
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(()
@@ -2365,7 +2365,7 @@
                     listener: handleInvalidStatement(=>, GeneratorReturnsValue)
                 listener: endClassMethod(null, (, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, ()
+            notEofOrType(CLOSE_CURLY_BRACKET, ()
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(()
@@ -2429,7 +2429,7 @@
                 inPlainSync()
                 parseFunctionBody(*, false, false)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, throw)
+                  notEofOrType(CLOSE_CURLY_BRACKET, throw)
                   parseStatement({)
                     parseStatementX({)
                       parseExpressionStatementOrDeclaration({, null)
@@ -2449,11 +2449,11 @@
                                 listener: handleThrowExpression(throw, "hello")
                             ensureSemicolon("hello")
                             listener: handleExpressionStatement(throw, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(null, (, (, null, })
               listener: endMember()
-            notEofOrValue(}, ()
+            notEofOrType(CLOSE_CURLY_BRACKET, ()
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(()
@@ -2529,7 +2529,7 @@
                     inGenerator()
                 listener: endClassMethod(get, (, =>, null, ;)
               listener: endMember()
-            notEofOrValue(}, ()
+            notEofOrType(CLOSE_CURLY_BRACKET, ()
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(()
@@ -2577,7 +2577,7 @@
                 inPlainSync()
                 parseFunctionBody(get, false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement({)
                     parseStatementX({)
                       parseReturnStatement({)
@@ -2608,11 +2608,11 @@
                         ensureSemicolon())
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(get, (, {, null, })
               listener: endMember()
-            notEofOrValue(}, ()
+            notEofOrType(CLOSE_CURLY_BRACKET, ()
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(()
@@ -2676,7 +2676,7 @@
                     inGenerator()
                 listener: endClassMethod(get, (, async, null, ;)
               listener: endMember()
-            notEofOrValue(}, ()
+            notEofOrType(CLOSE_CURLY_BRACKET, ()
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(()
@@ -2724,7 +2724,7 @@
                 inPlainSync()
                 parseFunctionBody(async, false, false)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, throw)
+                  notEofOrType(CLOSE_CURLY_BRACKET, throw)
                   parseStatement({)
                     parseStatementX({)
                       parseExpressionStatementOrDeclaration({, null)
@@ -2744,11 +2744,11 @@
                                 listener: handleThrowExpression(throw, "hello")
                             ensureSemicolon("hello")
                             listener: handleExpressionStatement(throw, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(get, (, async, null, })
               listener: endMember()
-            notEofOrValue(}, ()
+            notEofOrType(CLOSE_CURLY_BRACKET, ()
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(()
@@ -2813,7 +2813,7 @@
                     listener: handleInvalidStatement(=>, GeneratorReturnsValue)
                 listener: endClassMethod(get, (, async, null, ;)
               listener: endMember()
-            notEofOrValue(}, ()
+            notEofOrType(CLOSE_CURLY_BRACKET, ()
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(()
@@ -2861,7 +2861,7 @@
                 inPlainSync()
                 parseFunctionBody(*, false, false)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, throw)
+                  notEofOrType(CLOSE_CURLY_BRACKET, throw)
                   parseStatement({)
                     parseStatementX({)
                       parseExpressionStatementOrDeclaration({, null)
@@ -2881,11 +2881,11 @@
                                 listener: handleThrowExpression(throw, "hello")
                             ensureSemicolon("hello")
                             listener: handleExpressionStatement(throw, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(get, (, async, null, })
               listener: endMember()
-            notEofOrValue(}, ()
+            notEofOrType(CLOSE_CURLY_BRACKET, ()
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(()
@@ -2950,7 +2950,7 @@
                     listener: handleInvalidStatement(=>, GeneratorReturnsValue)
                 listener: endClassMethod(get, (, sync, null, ;)
               listener: endMember()
-            notEofOrValue(}, ()
+            notEofOrType(CLOSE_CURLY_BRACKET, ()
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(()
@@ -2998,7 +2998,7 @@
                 inPlainSync()
                 parseFunctionBody(*, false, false)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, throw)
+                  notEofOrType(CLOSE_CURLY_BRACKET, throw)
                   parseStatement({)
                     parseStatementX({)
                       parseExpressionStatementOrDeclaration({, null)
@@ -3018,11 +3018,11 @@
                                 listener: handleThrowExpression(throw, "hello")
                             ensureSemicolon("hello")
                             listener: handleExpressionStatement(throw, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(get, (, sync, null, })
               listener: endMember()
-            notEofOrValue(}, ()
+            notEofOrType(CLOSE_CURLY_BRACKET, ()
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(()
@@ -3098,7 +3098,7 @@
                     inGenerator()
                 listener: endClassMethod(get, (, =>, null, ;)
               listener: endMember()
-            notEofOrValue(}, ()
+            notEofOrType(CLOSE_CURLY_BRACKET, ()
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(()
@@ -3146,7 +3146,7 @@
                 inPlainSync()
                 parseFunctionBody(instanceGetter, false, true)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement({)
                     parseStatementX({)
                       parseReturnStatement({)
@@ -3177,11 +3177,11 @@
                         ensureSemicolon())
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(get, (, {, null, })
               listener: endMember()
-            notEofOrValue(}, ()
+            notEofOrType(CLOSE_CURLY_BRACKET, ()
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(()
@@ -3245,7 +3245,7 @@
                     inGenerator()
                 listener: endClassMethod(get, (, async, null, ;)
               listener: endMember()
-            notEofOrValue(}, ()
+            notEofOrType(CLOSE_CURLY_BRACKET, ()
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(()
@@ -3293,7 +3293,7 @@
                 inPlainSync()
                 parseFunctionBody(async, false, false)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement({)
                     parseStatementX({)
                       parseReturnStatement({)
@@ -3312,11 +3312,11 @@
                         ensureSemicolon("hello")
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(get, (, async, null, })
               listener: endMember()
-            notEofOrValue(}, ()
+            notEofOrType(CLOSE_CURLY_BRACKET, ()
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(()
@@ -3381,7 +3381,7 @@
                     listener: handleInvalidStatement(=>, GeneratorReturnsValue)
                 listener: endClassMethod(get, (, async, null, ;)
               listener: endMember()
-            notEofOrValue(}, ()
+            notEofOrType(CLOSE_CURLY_BRACKET, ()
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(()
@@ -3429,7 +3429,7 @@
                 inPlainSync()
                 parseFunctionBody(*, false, false)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement({)
                     parseStatementX({)
                       parseReturnStatement({)
@@ -3449,11 +3449,11 @@
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
                         listener: handleInvalidStatement(return, GeneratorReturnsValue)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(get, (, async, null, })
               listener: endMember()
-            notEofOrValue(}, ()
+            notEofOrType(CLOSE_CURLY_BRACKET, ()
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Foo)
               parseMetadataStar(})
                 listener: beginMetadataStar(()
@@ -3518,7 +3518,7 @@
                     listener: handleInvalidStatement(=>, GeneratorReturnsValue)
                 listener: endClassMethod(get, (, sync, null, ;)
               listener: endMember()
-            notEofOrValue(}, ()
+            notEofOrType(CLOSE_CURLY_BRACKET, ()
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(()
@@ -3566,7 +3566,7 @@
                 inPlainSync()
                 parseFunctionBody(*, false, false)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement({)
                     parseStatementX({)
                       parseReturnStatement({)
@@ -3586,11 +3586,11 @@
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
                         listener: handleInvalidStatement(return, GeneratorReturnsValue)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(get, (, sync, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 24, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -3617,7 +3617,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Bar, DeclarationKind.Class, Bar)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Bar)
               parseMetadataStar({)
                 listener: beginMetadataStar(static)
@@ -3708,7 +3708,7 @@
                     inGenerator()
                 listener: endClassMethod(null, static, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Bar)
               parseMetadataStar(;)
                 listener: beginMetadataStar(static)
@@ -3771,7 +3771,7 @@
                   inPlainSync()
                 parseFunctionBody(), false, false)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement({)
                     parseStatementX({)
                       parseReturnStatement({)
@@ -3802,11 +3802,11 @@
                         ensureSemicolon())
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(null, static, (, null, })
               listener: endMember()
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Bar)
               parseMetadataStar(})
                 listener: beginMetadataStar(static)
@@ -3885,7 +3885,7 @@
                     inGenerator()
                 listener: endClassMethod(null, static, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Bar)
               parseMetadataStar(;)
                 listener: beginMetadataStar(static)
@@ -3948,7 +3948,7 @@
                   inPlainSync()
                 parseFunctionBody(async, false, false)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, throw)
+                  notEofOrType(CLOSE_CURLY_BRACKET, throw)
                   parseStatement({)
                     parseStatementX({)
                       parseExpressionStatementOrDeclaration({, null)
@@ -3968,11 +3968,11 @@
                                 listener: handleThrowExpression(throw, "hello")
                             ensureSemicolon("hello")
                             listener: handleExpressionStatement(throw, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(null, static, (, null, })
               listener: endMember()
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Bar)
               parseMetadataStar(})
                 listener: beginMetadataStar(static)
@@ -4052,7 +4052,7 @@
                     listener: handleInvalidStatement(=>, GeneratorReturnsValue)
                 listener: endClassMethod(null, static, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Bar)
               parseMetadataStar(;)
                 listener: beginMetadataStar(static)
@@ -4115,7 +4115,7 @@
                   inPlainSync()
                 parseFunctionBody(*, false, false)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, throw)
+                  notEofOrType(CLOSE_CURLY_BRACKET, throw)
                   parseStatement({)
                     parseStatementX({)
                       parseExpressionStatementOrDeclaration({, null)
@@ -4135,11 +4135,11 @@
                                 listener: handleThrowExpression(throw, "hello")
                             ensureSemicolon("hello")
                             listener: handleExpressionStatement(throw, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(null, static, (, null, })
               listener: endMember()
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Bar)
               parseMetadataStar(})
                 listener: beginMetadataStar(static)
@@ -4219,7 +4219,7 @@
                     listener: handleInvalidStatement(=>, GeneratorReturnsValue)
                 listener: endClassMethod(null, static, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Bar)
               parseMetadataStar(;)
                 listener: beginMetadataStar(static)
@@ -4282,7 +4282,7 @@
                   inPlainSync()
                 parseFunctionBody(*, false, false)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, throw)
+                  notEofOrType(CLOSE_CURLY_BRACKET, throw)
                   parseStatement({)
                     parseStatementX({)
                       parseExpressionStatementOrDeclaration({, null)
@@ -4302,11 +4302,11 @@
                                 listener: handleThrowExpression(throw, "hello")
                             ensureSemicolon("hello")
                             listener: handleExpressionStatement(throw, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(null, static, (, null, })
               listener: endMember()
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Bar)
               parseMetadataStar(})
                 listener: beginMetadataStar(static)
@@ -4381,7 +4381,7 @@
                     inGenerator()
                 listener: endClassMethod(get, static, =>, null, ;)
               listener: endMember()
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Bar)
               parseMetadataStar(;)
                 listener: beginMetadataStar(static)
@@ -4428,7 +4428,7 @@
                 inPlainSync()
                 parseFunctionBody(get, false, false)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement({)
                     parseStatementX({)
                       parseReturnStatement({)
@@ -4459,11 +4459,11 @@
                         ensureSemicolon())
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(get, static, {, null, })
               listener: endMember()
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Bar)
               parseMetadataStar(})
                 listener: beginMetadataStar(static)
@@ -4526,7 +4526,7 @@
                     inGenerator()
                 listener: endClassMethod(get, static, async, null, ;)
               listener: endMember()
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Bar)
               parseMetadataStar(;)
                 listener: beginMetadataStar(static)
@@ -4573,7 +4573,7 @@
                 inPlainSync()
                 parseFunctionBody(async, false, false)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, throw)
+                  notEofOrType(CLOSE_CURLY_BRACKET, throw)
                   parseStatement({)
                     parseStatementX({)
                       parseExpressionStatementOrDeclaration({, null)
@@ -4593,11 +4593,11 @@
                                 listener: handleThrowExpression(throw, "hello")
                             ensureSemicolon("hello")
                             listener: handleExpressionStatement(throw, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(get, static, async, null, })
               listener: endMember()
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Bar)
               parseMetadataStar(})
                 listener: beginMetadataStar(static)
@@ -4661,7 +4661,7 @@
                     listener: handleInvalidStatement(=>, GeneratorReturnsValue)
                 listener: endClassMethod(get, static, async, null, ;)
               listener: endMember()
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Bar)
               parseMetadataStar(;)
                 listener: beginMetadataStar(static)
@@ -4708,7 +4708,7 @@
                 inPlainSync()
                 parseFunctionBody(*, false, false)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, throw)
+                  notEofOrType(CLOSE_CURLY_BRACKET, throw)
                   parseStatement({)
                     parseStatementX({)
                       parseExpressionStatementOrDeclaration({, null)
@@ -4728,11 +4728,11 @@
                                 listener: handleThrowExpression(throw, "hello")
                             ensureSemicolon("hello")
                             listener: handleExpressionStatement(throw, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(get, static, async, null, })
               listener: endMember()
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Bar)
               parseMetadataStar(})
                 listener: beginMetadataStar(static)
@@ -4796,7 +4796,7 @@
                     listener: handleInvalidStatement(=>, GeneratorReturnsValue)
                 listener: endClassMethod(get, static, sync, null, ;)
               listener: endMember()
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Bar)
               parseMetadataStar(;)
                 listener: beginMetadataStar(static)
@@ -4843,7 +4843,7 @@
                 inPlainSync()
                 parseFunctionBody(*, false, false)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, throw)
+                  notEofOrType(CLOSE_CURLY_BRACKET, throw)
                   parseStatement({)
                     parseStatementX({)
                       parseExpressionStatementOrDeclaration({, null)
@@ -4863,11 +4863,11 @@
                                 listener: handleThrowExpression(throw, "hello")
                             ensureSemicolon("hello")
                             listener: handleExpressionStatement(throw, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(get, static, sync, null, })
               listener: endMember()
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Bar)
               parseMetadataStar(})
                 listener: beginMetadataStar(static)
@@ -4942,7 +4942,7 @@
                     inGenerator()
                 listener: endClassMethod(get, static, =>, null, ;)
               listener: endMember()
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Bar)
               parseMetadataStar(;)
                 listener: beginMetadataStar(static)
@@ -4989,7 +4989,7 @@
                 inPlainSync()
                 parseFunctionBody(staticGetter, false, false)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, return)
+                  notEofOrType(CLOSE_CURLY_BRACKET, return)
                   parseStatement({)
                     parseStatementX({)
                       parseReturnStatement({)
@@ -5020,11 +5020,11 @@
                         ensureSemicolon())
                         listener: endReturnStatement(true, return, ;)
                         inGenerator()
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(get, static, {, null, })
               listener: endMember()
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Bar)
               parseMetadataStar(})
                 listener: beginMetadataStar(static)
@@ -5087,7 +5087,7 @@
                     inGenerator()
                 listener: endClassMethod(get, static, async, null, ;)
               listener: endMember()
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Bar)
               parseMetadataStar(;)
                 listener: beginMetadataStar(static)
@@ -5134,7 +5134,7 @@
                 inPlainSync()
                 parseFunctionBody(async, false, false)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, throw)
+                  notEofOrType(CLOSE_CURLY_BRACKET, throw)
                   parseStatement({)
                     parseStatementX({)
                       parseExpressionStatementOrDeclaration({, null)
@@ -5154,11 +5154,11 @@
                                 listener: handleThrowExpression(throw, "hello")
                             ensureSemicolon("hello")
                             listener: handleExpressionStatement(throw, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(get, static, async, null, })
               listener: endMember()
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Bar)
               parseMetadataStar(})
                 listener: beginMetadataStar(static)
@@ -5222,7 +5222,7 @@
                     listener: handleInvalidStatement(=>, GeneratorReturnsValue)
                 listener: endClassMethod(get, static, async, null, ;)
               listener: endMember()
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Bar)
               parseMetadataStar(;)
                 listener: beginMetadataStar(static)
@@ -5269,7 +5269,7 @@
                 inPlainSync()
                 parseFunctionBody(*, false, false)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, throw)
+                  notEofOrType(CLOSE_CURLY_BRACKET, throw)
                   parseStatement({)
                     parseStatementX({)
                       parseExpressionStatementOrDeclaration({, null)
@@ -5289,11 +5289,11 @@
                                 listener: handleThrowExpression(throw, "hello")
                             ensureSemicolon("hello")
                             listener: handleExpressionStatement(throw, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(get, static, async, null, })
               listener: endMember()
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(}, DeclarationKind.Class, Bar)
               parseMetadataStar(})
                 listener: beginMetadataStar(static)
@@ -5357,7 +5357,7 @@
                     listener: handleInvalidStatement(=>, GeneratorReturnsValue)
                 listener: endClassMethod(get, static, sync, null, ;)
               listener: endMember()
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Bar)
               parseMetadataStar(;)
                 listener: beginMetadataStar(static)
@@ -5404,7 +5404,7 @@
                 inPlainSync()
                 parseFunctionBody(*, false, false)
                   listener: beginBlockFunctionBody({)
-                  notEofOrValue(}, throw)
+                  notEofOrType(CLOSE_CURLY_BRACKET, throw)
                   parseStatement({)
                     parseStatementX({)
                       parseExpressionStatementOrDeclaration({, null)
@@ -5424,11 +5424,11 @@
                                 listener: handleThrowExpression(throw, "hello")
                             ensureSemicolon("hello")
                             listener: handleExpressionStatement(throw, ;)
-                  notEofOrValue(}, })
+                  notEofOrType(CLOSE_CURLY_BRACKET, })
                   listener: endBlockFunctionBody(1, {, })
                 listener: endClassMethod(get, static, sync, null, })
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 24, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/record/record_type_in_for_loop.dart.intertwined.expect b/pkg/front_end/parser_testcases/record/record_type_in_for_loop.dart.intertwined.expect
index d487a6c2..5c9ae57 100644
--- a/pkg/front_end/parser_testcases/record/record_type_in_for_loop.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/record/record_type_in_for_loop.dart.intertwined.expect
@@ -26,7 +26,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, for)
+          notEofOrType(CLOSE_CURLY_BRACKET, for)
           parseStatement({)
             parseStatementX({)
               parseForStatement({, null)
@@ -132,7 +132,7 @@
                       parseBlock(), BlockKind(statement))
                         ensureBlock(), BlockKind(statement))
                         listener: beginBlock({, BlockKind(statement))
-                        notEofOrValue(}, print)
+                        notEofOrType(CLOSE_CURLY_BRACKET, print)
                         parseStatement({)
                           parseStatementX({)
                             parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
@@ -145,7 +145,6 @@
                                         parseSendOrFunctionLiteral({, expression, ConstantPatternContext.none)
                                           looksLikeFunctionBody(;)
                                           parseSend({, expression, ConstantPatternContext.none)
-                                            isNextIdentifier({)
                                             ensureIdentifier({, expression)
                                               listener: handleIdentifier(print, expression)
                                             listener: handleNoTypeArguments(()
@@ -159,7 +158,6 @@
                                                         parsePrimary((, expression, ConstantPatternContext.none)
                                                           parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
                                                             parseSend((, expression, ConstantPatternContext.none)
-                                                              isNextIdentifier(()
                                                               ensureIdentifier((, expression)
                                                                 listener: handleIdentifier(x, expression)
                                                               listener: handleNoTypeArguments())
@@ -170,11 +168,11 @@
                                             listener: handleSend(print, ))
                                 ensureSemicolon())
                                 listener: handleExpressionStatement(print, ;)
-                        notEofOrValue(}, })
+                        notEofOrType(CLOSE_CURLY_BRACKET, })
                         listener: endBlock(1, {, }, BlockKind(statement))
                   listener: endForInBody(})
                   listener: endForIn(})
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod(main, null, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/record/record_type_return_on_function_with_type_parameter.dart.intertwined.expect b/pkg/front_end/parser_testcases/record/record_type_return_on_function_with_type_parameter.dart.intertwined.expect
index 93da1d8..736b278 100644
--- a/pkg/front_end/parser_testcases/record/record_type_return_on_function_with_type_parameter.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/record/record_type_return_on_function_with_type_parameter.dart.intertwined.expect
@@ -67,7 +67,7 @@
           inPlainSync()
         parseFunctionBody(), false, false)
           listener: beginBlockFunctionBody({)
-          notEofOrValue(}, return)
+          notEofOrType(CLOSE_CURLY_BRACKET, return)
           parseStatement({)
             parseStatementX({)
               parseReturnStatement({)
@@ -91,7 +91,6 @@
                                   parsePrimary(,, expression, ConstantPatternContext.none)
                                     parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                       parseSend(,, expression, ConstantPatternContext.none)
-                                        isNextIdentifier(,)
                                         ensureIdentifier(,, expression)
                                           listener: handleIdentifier(t, expression)
                                         listener: handleNoTypeArguments())
@@ -103,7 +102,7 @@
                 ensureSemicolon())
                 listener: endReturnStatement(true, return, ;)
                 inGenerator()
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endBlockFunctionBody(1, {, })
         listener: endTopLevelMethod((, null, })
   listener: endTopLevelDeclaration(})
@@ -191,7 +190,6 @@
                               parsePrimary(,, expression, ConstantPatternContext.none)
                                 parseSendOrFunctionLiteral(,, expression, ConstantPatternContext.none)
                                   parseSend(,, expression, ConstantPatternContext.none)
-                                    isNextIdentifier(,)
                                     ensureIdentifier(,, expression)
                                       listener: handleIdentifier(t, expression)
                                     listener: handleNoTypeArguments())
diff --git a/pkg/front_end/parser_testcases/record/record_type_setter.dart.intertwined.expect b/pkg/front_end/parser_testcases/record/record_type_setter.dart.intertwined.expect
index 8fe4680..bfecb48 100644
--- a/pkg/front_end/parser_testcases/record/record_type_setter.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/record/record_type_setter.dart.intertwined.expect
@@ -354,7 +354,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Foo, DeclarationKind.Class, Foo)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, ()
+            notEofOrType(CLOSE_CURLY_BRACKET, ()
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Foo)
               parseMetadataStar({)
                 listener: beginMetadataStar(()
@@ -446,7 +446,7 @@
                     inGenerator()
                 listener: endClassMethod(null, (, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(void)
@@ -535,7 +535,7 @@
                     inGenerator()
                 listener: endClassMethod(set, void, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, ()
+            notEofOrType(CLOSE_CURLY_BRACKET, ()
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(()
@@ -611,7 +611,7 @@
                     inGenerator()
                 listener: endClassMethod(get, (, =>, null, ;)
               listener: endMember()
-            notEofOrValue(}, void)
+            notEofOrType(CLOSE_CURLY_BRACKET, void)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(void)
@@ -700,7 +700,7 @@
                     inGenerator()
                 listener: endClassMethod(set, void, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 4, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
@@ -727,7 +727,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Bar, DeclarationKind.Class, Bar)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Bar)
               parseMetadataStar({)
                 listener: beginMetadataStar(static)
@@ -818,7 +818,7 @@
                     inGenerator()
                 listener: endClassMethod(null, static, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Bar)
               parseMetadataStar(;)
                 listener: beginMetadataStar(static)
@@ -906,7 +906,7 @@
                     inGenerator()
                 listener: endClassMethod(set, static, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Bar)
               parseMetadataStar(;)
                 listener: beginMetadataStar(static)
@@ -981,7 +981,7 @@
                     inGenerator()
                 listener: endClassMethod(get, static, =>, null, ;)
               listener: endMember()
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Bar)
               parseMetadataStar(;)
                 listener: beginMetadataStar(static)
@@ -1069,7 +1069,7 @@
                     inGenerator()
                 listener: endClassMethod(set, static, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 4, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/record/record_type_with_modifiers.dart.intertwined.expect b/pkg/front_end/parser_testcases/record/record_type_with_modifiers.dart.intertwined.expect
index 99da0f1..a57cfe1 100644
--- a/pkg/front_end/parser_testcases/record/record_type_with_modifiers.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/record/record_type_with_modifiers.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Foo, DeclarationKind.Class, Foo)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, final)
+            notEofOrType(CLOSE_CURLY_BRACKET, final)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Foo)
               parseMetadataStar({)
                 listener: beginMetadataStar(final)
@@ -87,7 +87,7 @@
                   listener: endFieldInitializer(=, ))
                 listener: endClassFields(null, null, null, null, null, null, final, 1, final, ;)
               listener: endMember()
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(static)
@@ -148,7 +148,7 @@
                   listener: endFieldInitializer(=, ))
                 listener: endClassFields(null, null, null, static, null, null, null, 1, static, ;)
               listener: endMember()
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(static)
@@ -210,7 +210,7 @@
                   listener: endFieldInitializer(=, ))
                 listener: endClassFields(null, null, null, static, null, null, final, 1, static, ;)
               listener: endMember()
-            notEofOrValue(}, static)
+            notEofOrType(CLOSE_CURLY_BRACKET, static)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(static)
@@ -272,7 +272,7 @@
                   listener: endFieldInitializer(=, ))
                 listener: endClassFields(null, null, null, static, null, null, const, 1, static, ;)
               listener: endMember()
-            notEofOrValue(}, late)
+            notEofOrType(CLOSE_CURLY_BRACKET, late)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(late)
@@ -311,7 +311,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, null, null, late, null, 1, late, ;)
               listener: endMember()
-            notEofOrValue(}, late)
+            notEofOrType(CLOSE_CURLY_BRACKET, late)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(late)
@@ -351,7 +351,7 @@
                   listener: handleNoFieldInitializer(;)
                 listener: endClassFields(null, null, null, null, null, late, final, 1, late, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 6, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/record/super_parameters_record_type.dart.intertwined.expect b/pkg/front_end/parser_testcases/record/super_parameters_record_type.dart.intertwined.expect
index b798b18..807934b 100644
--- a/pkg/front_end/parser_testcases/record/super_parameters_record_type.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/record/super_parameters_record_type.dart.intertwined.expect
@@ -28,7 +28,7 @@
             listener: handleClassHeader(class, class, null)
           parseClassOrMixinOrExtensionBody(Bar, DeclarationKind.Class, Foo)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, Foo)
+            notEofOrType(CLOSE_CURLY_BRACKET, Foo)
             parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, Foo)
               parseMetadataStar({)
                 listener: beginMetadataStar(Foo)
@@ -90,7 +90,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, Foo, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, Foo)
+            notEofOrType(CLOSE_CURLY_BRACKET, Foo)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(Foo)
@@ -156,7 +156,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, Foo, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, Foo)
+            notEofOrType(CLOSE_CURLY_BRACKET, Foo)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(Foo)
@@ -222,7 +222,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, Foo, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, Foo)
+            notEofOrType(CLOSE_CURLY_BRACKET, Foo)
             parseClassOrMixinOrExtensionOrEnumMemberImpl(;, DeclarationKind.Class, Foo)
               parseMetadataStar(;)
                 listener: beginMetadataStar(Foo)
@@ -288,7 +288,7 @@
                   listener: handleEmptyFunctionBody(;)
                 listener: endClassConstructor(null, Foo, (, null, ;)
               listener: endMember()
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 4, {, })
           listener: endClassDeclaration(class, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/parser_testcases/sealed_class/sealed_class.dart.intertwined.expect b/pkg/front_end/parser_testcases/sealed_class/sealed_class.dart.intertwined.expect
index c7093b0..3b52ae3 100644
--- a/pkg/front_end/parser_testcases/sealed_class/sealed_class.dart.intertwined.expect
+++ b/pkg/front_end/parser_testcases/sealed_class/sealed_class.dart.intertwined.expect
@@ -25,7 +25,7 @@
             listener: handleClassHeader(sealed, class, null)
           parseClassOrMixinOrExtensionBody(Class, DeclarationKind.Class, Class)
             listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
-            notEofOrValue(}, })
+            notEofOrType(CLOSE_CURLY_BRACKET, })
             listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
           listener: endClassDeclaration(sealed, })
   listener: endTopLevelDeclaration(})
@@ -48,7 +48,7 @@
           listener: handleMixinHeader(mixin)
         parseClassOrMixinOrExtensionBody(M, DeclarationKind.Mixin, M)
           listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Mixin, {)
-          notEofOrValue(}, })
+          notEofOrType(CLOSE_CURLY_BRACKET, })
           listener: endClassOrMixinOrExtensionBody(DeclarationKind.Mixin, 0, {, })
         listener: endMixinDeclaration(mixin, })
   listener: endTopLevelDeclaration(})
diff --git a/pkg/front_end/test/ambiguous_export_test.dart b/pkg/front_end/test/ambiguous_export_test.dart
index 6281188..5a92eda 100644
--- a/pkg/front_end/test/ambiguous_export_test.dart
+++ b/pkg/front_end/test/ambiguous_export_test.dart
@@ -31,7 +31,7 @@
       target.loader.buildOutline(builder);
       builder.markAsReadyToFinalizeExports();
       var mainExport =
-          builder.exportNameSpace.lookupLocalMember("main")?.getable;
+          builder.exportNameSpace.lookup("main")?.getable;
       Expect.isTrue(mainExport is InvalidBuilder);
     });
   });
diff --git a/pkg/front_end/test/coverage_suite_expected.dart b/pkg/front_end/test/coverage_suite_expected.dart
index f5ddd47..19f101c 100644
--- a/pkg/front_end/test/coverage_suite_expected.dart
+++ b/pkg/front_end/test/coverage_suite_expected.dart
@@ -180,12 +180,12 @@
   ),
   // 100.0%.
   "package:front_end/src/base/local_scope.dart": (
-    hitCount: 48,
+    hitCount: 49,
     missCount: 0,
   ),
   // 100.0%.
   "package:front_end/src/base/lookup_result.dart": (
-    hitCount: 43,
+    hitCount: 38,
     missCount: 0,
   ),
   // 100.0%.
@@ -200,7 +200,7 @@
   ),
   // 100.0%.
   "package:front_end/src/base/name_space.dart": (
-    hitCount: 146,
+    hitCount: 136,
     missCount: 0,
   ),
   // 100.0%.
@@ -220,7 +220,7 @@
   ),
   // 100.0%.
   "package:front_end/src/base/scope.dart": (
-    hitCount: 177,
+    hitCount: 178,
     missCount: 0,
   ),
   // 100.0%.
@@ -270,7 +270,7 @@
   ),
   // 100.0%.
   "package:front_end/src/builder/constructor_reference_builder.dart": (
-    hitCount: 50,
+    hitCount: 43,
     missCount: 0,
   ),
   // 100.0%.
@@ -350,7 +350,7 @@
   ),
   // 100.0%.
   "package:front_end/src/builder/named_type_builder.dart": (
-    hitCount: 615,
+    hitCount: 611,
     missCount: 0,
   ),
   // 100.0%.
@@ -690,7 +690,7 @@
   ),
   // 100.0%.
   "package:front_end/src/kernel/body_builder.dart": (
-    hitCount: 7204,
+    hitCount: 7198,
     missCount: 0,
   ),
   // 100.0%.
@@ -750,7 +750,7 @@
   ),
   // 100.0%.
   "package:front_end/src/kernel/expression_generator.dart": (
-    hitCount: 2529,
+    hitCount: 2532,
     missCount: 0,
   ),
   // 100.0%.
@@ -840,7 +840,7 @@
   ),
   // 100.0%.
   "package:front_end/src/kernel/kernel_target.dart": (
-    hitCount: 1038,
+    hitCount: 1037,
     missCount: 0,
   ),
   // 100.0%.
diff --git a/pkg/front_end/test/parser/literal_entry_info_test.dart b/pkg/front_end/test/parser/literal_entry_info_test.dart
index df9e4f1..384e073 100644
--- a/pkg/front_end/test/parser/literal_entry_info_test.dart
+++ b/pkg/front_end/test/parser/literal_entry_info_test.dart
@@ -916,6 +916,11 @@
   }
 
   @override
+  void handleEndingBinaryExpression(Token token, Token endToken) {
+    calls.add('handleEndingBinaryExpression $token');
+  }
+
+  @override
   void endBinaryExpression(Token token, Token endToken) {
     calls.add('endBinaryExpression $token');
   }
diff --git a/pkg/front_end/test/parser_test_parser.dart b/pkg/front_end/test/parser_test_parser.dart
index 7a1525a..31e313f 100644
--- a/pkg/front_end/test/parser_test_parser.dart
+++ b/pkg/front_end/test/parser_test_parser.dart
@@ -1000,15 +1000,6 @@
   }
 
   @override
-  bool isNextIdentifier(Token token) {
-    doPrint('isNextIdentifier(' '$token)');
-    indent++;
-    var result = super.isNextIdentifier(token);
-    indent--;
-    return result;
-  }
-
-  @override
   Token ensureIdentifierPotentiallyRecovered(
     Token token,
     IdentifierContext context,
@@ -1026,10 +1017,10 @@
   }
 
   @override
-  bool notEofOrValue(String value, Token token) {
-    doPrint('notEofOrValue(' '$value, ' '$token)');
+  bool notEofOrType(TokenType type, Token token) {
+    doPrint('notEofOrType(' '$type, ' '$token)');
     indent++;
-    var result = super.notEofOrValue(value, token);
+    var result = super.notEofOrType(type, token);
     indent--;
     return result;
   }
diff --git a/tools/VERSION b/tools/VERSION
index 0157239..a4324ea 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
 MAJOR 3
 MINOR 10
 PATCH 0
-PRERELEASE 47
+PRERELEASE 48
 PRERELEASE_PATCH 0