| Index: pkg/front_end/lib/src/fasta/parser/parser.dart
|
| diff --git a/pkg/front_end/lib/src/fasta/parser/parser.dart b/pkg/front_end/lib/src/fasta/parser/parser.dart
|
| index c2b8fc7e204337cca87f4e47f67fc40b4ec0a374..f7e2e1f90c1ca2e2ecc07d131512ef7aaa3a7661 100644
|
| --- a/pkg/front_end/lib/src/fasta/parser/parser.dart
|
| +++ b/pkg/front_end/lib/src/fasta/parser/parser.dart
|
| @@ -261,8 +261,12 @@ class Parser {
|
| return parseExport(token);
|
| } else if (identical(value, 'part')) {
|
| return parsePartOrPartOf(token);
|
| - } else {
|
| + } else if (token.type == TokenType.IDENTIFIER || token.keyword != null) {
|
| return parseTopLevelMember(token);
|
| + } else {
|
| + reportRecoverableErrorWithToken(token, fasta.templateExpectedDeclaration);
|
| + listener.handleInvalidTopLevelDeclaration(token);
|
| + return token.next;
|
| }
|
| }
|
|
|
|
|